flat assembler
Message board for the users of flat assembler.

Index > OS Construction > race condition on a smp system

Author
Thread Post new topic Reply to topic
FlashBurn



Joined: 06 Jan 2005
Posts: 87
FlashBurn
It seems I will never get my OS to run on a smp system, because of the many race conditions Sad

I attached my scheduler code. It seems to be a race condition when my semaphore code calls the function "scheduler_add_scheduler". I get a page fault because ebx (lastThread) is NULL. But it can´t be NULL when the code works right. If here is someone who has time and could have a look at my code, maybe he will see something which wont work on a smp system!


Description:
Download
Filename: scheduler.inc
Filesize: 19.81 KB
Downloaded: 93 Time(s)

Post 03 Oct 2005, 08:04
View user's profile Send private message Reply with quote
james



Joined: 07 Sep 2005
Posts: 45
Location: Australia
james
Please can you describe the algo your using for protecting resources from concurrent use ?

SMP issues typically stem from thinking a single lock is going to protect a resource, when in fact more than one is needed in some circumstances.
Post 03 Oct 2005, 22:03
View user's profile Send private message MSN Messenger Reply with quote
FlashBurn



Joined: 06 Jan 2005
Posts: 87
FlashBurn
I use a spinlock to protect the priority queue for the threads. I think that it could be that when cpu1 has the semaphore and wakes up a thread that cpu0 hasn´t finished with that thread. But for this there is also a spinlock for every thread that the scheduler takes.
Post 04 Oct 2005, 04:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.