News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Where can I find a tutorial on multi-threading?

Started by xanatose, October 11, 2007, 10:23:27 PM

Previous topic - Next topic

xanatose

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.

u

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.
Please use a smaller graphic in your signature.


hutch--

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

u

Please use a smaller graphic in your signature.