lkml.org 
[lkml]   [1999]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.275 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site