The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xanatose on October 11, 2007, 10:23:27 PM

Title: Where can I find a tutorial on multi-threading?
Post by: xanatose on October 11, 2007, 10:23:27 PM
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.
Title: Re: Where can I find a tutorial on multi-threading?
Post by: u on October 12, 2007, 04:29:42 PM
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.
Title: Re: Where can I find a tutorial on multi-threading?
Post by: xanatose on October 12, 2007, 10:06:19 PM
Thank you
Title: Re: Where can I find a tutorial on multi-threading?
Post by: hutch-- on October 12, 2007, 10:18:57 PM
Ultrano,

Link Link !!!!!
Title: Re: Where can I find a tutorial on multi-threading?
Post by: u on October 13, 2007, 03:12:32 AM
Here's the article

http://www.masm32.com/board/index.php?topic=6777.0