I am posting this more as a question to NT developers than Linux
developers. However, the numbers from my tests may be some interest
for the Linux developer. Since there is no NT system development
group, I posted this to advocacy and hope this will not turn into a
I am writting a server which spawn off large number thread to hand
event. Thus, the thread creating performance is very important. I have
run some testing on two identical PCs. One PC runs NT 4.0 SP3 and the
other runs Linux RedHat 4.2. The testing result shows Linux thread are
much more efficient than NT thread.
Linux uses LinuxThreads 0.6. A implementation of Pthread based on
Linux clone system call.
NT uses Win32 threads functions: CreateThread, CreateMutex,
WaitForSingleObjectEx, and ReleaseMutex.
Here is the number:
1. Spawn 1 million thread. The thread function is practically a null
function containing only a return statement. I don't have exact
timing but here is the test result.
When Linux finished, NT only spawns 450k+ threads.
2. 1 million mutex creating. Well... This is not exact meaningful but
the number is interesting.
When Linux finished, NT only creates 250k+ mutex.
3. 1 million mutex lock/unlock test. This tests how fast mutex
When Linux finished, NT finishs only 400k lock/unlock operation.
Any suggestion to improve perforamnce is appreciated. Thanks in
Ta-Wei "David" Li