RSS feed [root] /design /weblog /concurrency



title search:


Mon Jan 23 18:33:07 HKT 2017


Stealing thread -

Intel Guide for Developing Multithreaded Applications -[..]or-developing-multithreaded-applications

Difference ways to stop a thread -[..]ept_url=/hpc-high-performance-computing/

Interesting, I am not sure if I agree, but chrome ( which use fork ) are really cool in performance:
There’s another problem with Unix programming in Ruby that I’ll just touch on briefly: Java people and Windows people. They’re going to tell you that fork(2) is bad because they don’t have it on their platform, or it sucks on their platform, or whatever, but it’s cool, you know, because they have native threads, and threads are like, way better anyways.

Fuck that.

Don’t ever let anyone tell you that fork(2) is bad. Thirty years from now, there will still be a fork(2) and a pipe(2) and a exec(2) and smart people will still be using them to solve hard problems reliably and predictably, just like they were thirty years ago.

MRI Ruby people need to accept, like Python (you have seen multiprocessing, yes?), that Unix processes are one of two techniques for achieving reliable concurrency and parallelism in server applications. Threads are out. You can use processes, or async/events, or both processes and async/events, but definitely not threads. Threads are out.

1x1 win M*N -

Best number of threads:
N = number of CPUs
U = target CPU utilization (0 <= U <= 1)
W/C = ration of wait time to cpu time (measured through profiling)

threads = N * U * (1 + W/C) -[..]ratio-of-java-threads-to-cpus-on-solaris

Another post about tuning thread pool -[..]ortance-of-tuning-your-thread-pools.html

Threads Basics -

The Dos and Don'ts of Multithreading -[..]-26-09-low-level-threading-table-of.html

(google search) (amazon search)
download zip of files only