Blog - Threading is a bitch

Posted 2010-10-02 13:48:15 by thePowersGang

For the last month or so I have had blocker bugs in the Acess2 threading code. This has broken any real progress on the rest of the kernel, leaving me unable to work on the fun stuff (read IP/TCP and filesystems).

A quick explanation of the bug follows:
The main issue is that the list of currently running processes is not being maintained correctly, for some reason threads that are acutally sleeping are being kept on the running queue, this is causing bugchecking code to fire and panic the kernel. The converse is also happening, so threads that are still supposed to be active are being taken off the active queue (or not being put back on).
I feel that this bug is due to concurrency issues somewhere, but a visual inspection of the source shows no places where the thread lists are edited without proper locking in place, and enabling debugging seems to mask the bug somehow due to timing differences.
If someone feels like reading the code and finding my fault for me, please feel free to email me at acessdev [at] gmail [dot] com or acess [at] mutabah [dot] net