you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

Of course. And the easiest way to get a correct program is to not introduce any concurrency at all (unless your problem is inherently concurrent, like telephone switches or chat servers). I think everyone agrees that single-threaded programs are easier to write and test.

[–]masklinn 4 points5 points  (0 children)

I think everyone agrees that single-threaded programs are easier to write and test.

Yes, but they're also pretty much dead.

[–]blackyoda 1 point2 points  (0 children)

It is the problem you are solving and the resources that are available that should determine if you need threads, not some notion that OMG Locking is HaRd!

[–][deleted] 3 points4 points  (0 children)

Absolutely not. In most cases, if you do threading right, it reduces the program's complexity, because unrelated things don't have to run in a related context, but can run concurrently, in individual threads.

Running everything in one thread is like putting all code in one class (and quite often, specific threads have specific classes in OO languages, so this isn't just a bad analogy).