DragonFly kernel List (threaded) for 2005-11
tsleep/wakeup patch #2 (Re: tsleep/wakeup)
Here's the second iteration of the tsleep/wakeup patch:
This is even more experimental, but I am finding that the
signal/sleep/wakeup interactions we inherited from FreeBSD are even
more intertwined then I thought they were. It's taking a lot to unwind
Again, to test you want to create / destroy lots of processes as well
as send lots of signals (^T, ^C, ^Z, etc). Even try gdb'ing some
programs to test that the debugger still works :).
On the bright side, this will make some of the future LWP work easier.
I had to disentangle the process status (p_stat) from the sleeping vs
stopped (SSLEEP vs SSTOP) status. The process now has a P_STOPPED
flag which is independant of whether the process has actually managed
to stop yet or not. SSTOP is no longer a valid p_stat state, but it
is synthesized so programs like 'ps' can tell the difference between
a stopped process and a sleeping process.
As a consequence of the work, I also found a number of bugs... actually
one very well known bug which is if tsleep() is called with PCATCH,
a ^Z can sneak in there and cause the tsleep to not wake up until
the process is continued again. That little problem is now fixed. I
also fixed at least one ^Z / signal-parent race condition.
In anycase, please test! Clearly I won't be able to commit this on
Friday like I hoped... perhaps monday, depending on how much more work
I have to do on it.