News for hackers. Stuff that matters.
Re:C++11 threads tutorial by jbarham on Thursday March 08, 2012 @05:37PM (#3682034)
For C++, that's actually not too bad. Now try creating 100,000 threads with synchronized communication. In Go it's trivial:

		$ cat goroutines.go 
		package main

		import (
			"flag"
			"fmt"
		)

		var n *int = flag.Int("n", 100000, "thread count")

		func thread(x int, result chan int) {
			result <- x
		}

		func main() {
			flag.Parse()

			results := make(chan int)
			for i := 0; i < *n; i++ {
				go thread(i, results)
			}
			for i := 0; i < *n; i++ {
				fmt.Println(<-results)
			}
		}
		$ time ./goroutines | tail
		99990
		99991
		99992
		99993
		99994
		99995
		99996
		99997
		99998
		99999

		real	0m0.723s
		user	0m0.396s
		sys	0m0.840s
http://weekly.golang.org/doc/effective_go.html#concurrency
Re:C++11 threads tutorial by ramy_d on Thursday March 08, 2012 @06:14PM (#3682175)
I feel like your comment ignores what languages are for and what people looking for a c++11 tutorial on threading already know.

You might think an equally trivial example with erlang is in order, but it totally marginalizes why anyone chooses to write with any given language in the first place.