Since the trend seems to be more CPUs per chip, I wanted to (finally) learn about multi-treading programming.
Does anyone knows a tutorial on this subject? If possible, but not required, OS independant.
Specifically, how does one makes a library multi-threading safe without killing its performance on single CPU machines. So it can be use on different tasks at the same time.
Simple calls to CreateThread, InitializeCriticalSection, EnterCriticalSection, LeaveCriticalSection.
But to get best performance, you must understand how the OS works, the thread-scheduler specifically. So, read "inside windows 2000".
Too many people don't know/understand these internals, and go for the wrong API for their own needs. (i.e CreateEvent/WaitSingleObject versus SwitchToThread versus mutexes, etc). For Win2k/XP, I've written an article on "Fast readers-writer lock", search it here - it might give some insight on how fast the OS does some things, and thus when which API are preferred.
Thank you
Ultrano,
Link Link !!!!!
Here's the article
http://www.masm32.com/board/index.php?topic=6777.0