My scheduler doesn't work properly. It does register kernel threads correctly and also appears to switch stacks correctly inside the C code, but it doesn't actually happen. The kernel main() thread keeps running between timer interrupts and the code the threads are supposed to execute simply doesn't get executed...I checked this by setting the eip value of one kernel thread to some value that wasn't even paged, and no page fault was triggered!
Is there some bug right out on your view I'm too stupid/tired to see? If not, I'll post some more details tomorrow, but it's 2 am now and I'm too tired to search for bochs snapshots, etc.
Candamir
Weird scheduler problem...
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Weird scheduler problem...
Do you use some form of round robin scheduling?
Do you properly decrease the timeslices of the currently running task (i.e. the one in possession of the cpu)?
Do you properly detach a task to preempt from the front of the running-tasks queue and attach it to its rear?
Does your idle thread run in an endless loop (of course one might say but I ask nevertheless for a reason) and does it have a higher priority(if any) than the spawned threads?
Hope these questions help you to nail down the problem. It's something either with your queue handling or the task picking.
stay safe
Do you properly decrease the timeslices of the currently running task (i.e. the one in possession of the cpu)?
Do you properly detach a task to preempt from the front of the running-tasks queue and attach it to its rear?
Does your idle thread run in an endless loop (of course one might say but I ask nevertheless for a reason) and does it have a higher priority(if any) than the spawned threads?
Hope these questions help you to nail down the problem. It's something either with your queue handling or the task picking.
stay safe
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image