Messages in this thread | | | Date | Thu, 30 Dec 1999 14:03:53 -0500 (EST) | From | "Richard B. Johnson" <> | Subject | Re: sleep_on, wake_up question |
| |
On Thu, 30 Dec 1999, Alan Cox wrote:
> > In the code above, is there any possibility of the process' state being > > changed prior to the schedule() call (i.e. can nonblocking kernel code be > > context-switched out?) > > > > None. Although it may be executed in parallel with other code on an SMP box
Really? Then you don't need any locks, semiphores, or anything... The 'code' that is executing is 'current' user-mode code. Looking at the scheduler, 'current' can change when the HZ is up and there is another computable process.
If I do:
for(;;) ;
-- never returning, in an ioctl(), the box doesn't hang, it just gets very slow. Context switches are occurring. Or have I been using a SMP machine too long?
Cheers, Dick Johnson
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips). Warning : The end of the world as we know it requires a new calendar. Seconds : 122167 (until Y2K)
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |