Understanding goroutines

There are a few things to keep in mind about Go’s goroutines: They are not threads in the sense of Java’s or C++ threads goroutines are more like greenlets The go runtime multiplexes the goroutines across the system threads the number of system threads is controlled by an environment variable GOMAXPROCS and defaults to 1 … Read more

Fast and Best Producer/consumer queue technique BlockingCollection vs concurrent Queue [closed]

BlockingCollection and ConcurrentQueue are there for precisely this reason. I doubt that you’ll find anything better, or simpler to use. The parallel extensions team know their stuff 🙂 Just a quick check on versions though – you’re definitely using .NET 4, not just C# 4? (For example, you could be using Visual Studio 2010 and … Read more

Golang concurrency: how to append to the same slice from different goroutines

There is nothing wrong with guarding the MySlice = append(MySlice, &OneOfMyStructs) with a sync.Mutex. But of course you can have a result channel with buffer size len(params) all goroutines send their answers and once your work is finished you collect from this result channel. If your params has a fixed size: MySlice = make([]*MyStruct, len(params)) … Read more

Concurrency model: Erlang vs Clojure

Do you really mean concurrent or distributed? If you mean concurrent (multi-threaded, multi-core etc.), then I’d say Clojure is the natural solution. Clojure’s STM model is perfectly designed for multi-core concurrency since it is very efficient at storing and managing shared state between threads. If you want to understand more, well worth looking at this … Read more

What’s the difference between the message passing and shared memory concurrency models?

It’s a pretty simple difference. In a shared memory model, multiple workers all operate on the same data. This opens up a lot of the concurrency issues that are common in parallel programming. Message passing systems make workers communicate through a messaging system. Messages keep everyone seperated, so that workers cannot modify each other’s data. … Read more

How are you taking advantage of Multicore?

My research work includes work on compilers and on spam filtering. I also do a lot of ‘personal productivity’ Unix stuff. Plus I write and use software to administer classes that I teach, which includes grading, testing student code, tracking grades, and myriad other trivia. Multicore affects me not at all except as a research … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)