[concurrency-interest] Context-switching VS Continuation

Boehm, Hans hans.boehm at hp.com
Thu Jun 9 17:03:42 EDT 2005


> -----Original Message-----
> From: Dawid Kurzyniec
> Linux prior to 2.6 had poor thread switching performance, 
> AFAIK mostly 
> because there was no dedicated abstraction of a thread at the 
> low level 
> (threads were essentially processes). MS Windows and Solaris were 
> actually much better in that respect, since they supported threads 
> natively. But Linux kernel 2.6 has changed the game - all the 
> threading 
> stuff has been reimplemented, and it is much faster now. I can't give 
> exact numbers, but I would suggest you first run some benchmarks to 
> measure the overheads that you are trying to beat.
> 
My impression is that the changes relevant to thread switch performance
in Linux around this time were:

- Futexes, which presumably eliminated the use of signals to
wake up blocked processes.
- A different scheduler.

I don't think this had much to do with better kernel understanding of
threads,
though that helps for Posix-compliance.  Unlike older versions of
Solaris,
Linux thread switches have always been done in the kernel.

Hans



More information about the Concurrency-interest mailing list