On Tue, 8 Jun 1999, Vincent Diepeveen wrote:
> Here i describe something that works very bad in all OS-es i tested it
> at. I tested it at NT and Linux. w95/w98 i can't take serious enough to
> even consider testing it at.
>
> Consider i have 4 processes. First process sets variable in
> shared memory struct Tree.
>
> tree->waitforsearch = true;
>
> Now other 3 processes get started.
> They start till they get into the next loop:
>
> do {
> ;
> } while( tree->waitforsearch );
>
> InitializeSettings();
> while( tree->job ) {
> tree->waitingformove[ProcessorNumber] = true;
> do {
> ;
> } while( tree->waitformove );
> DoYourJob();
> }
Maybe I'm missing something, but why aren't you using semaphores here?
Busy waiting is hardly the way to high performance synchronization
(especially on a UP system)... it seems unfair to blame the OS for poorly
handling what looks to me like a poor strategy.
-Andy
Global Auctions
http://www.globalauctions.com
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]