lkml.org 
[lkml]   [1998]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: scrolling eats too much cpu (2)
Date
> So, when a program writes large blocks to graphical console (e.g.
> telnet or cat), scheduling does not occur quite a long time.
>
> I tried the following hack, and it helped in -opost case. But I know
> it's not correct solution. Any ideas?

There is a flag the scheduler keeps on the current task you can test
to see if it thinks you should by now have given up the CPU. So providing
you put it somewhere that sleeping is ok (eg by the copy from user)
then

if(current->need_resched)
schedule();

should do the trick


-
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:46    [W:1.742 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site