How is threading different from tasks using shared memory? (original) (raw)
Switching
Fast. Since the data is inherently shared, the context switches don't have to flush all the memory management buffers. On other systems (non-linux), this can be very fast. However, I must point out that the benchmarks done on Linux vs. NT and others have clearly placed Linux in the context-switching lead. Private data - No such thing. If you clone() with data and stack shared, all subsequent memory allocations can be seen by other threads. I well-behaved program will naturally shadow this, making it a non-issue.