linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Task Switching in Linux
@ 2001-06-11 20:30 Jaswinder Singh
  2001-06-11 22:45 ` george anzinger
  0 siblings, 1 reply; 3+ messages in thread
From: Jaswinder Singh @ 2001-06-11 20:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jaswinder Singh

In Linux , If we assume that there are only 2 tasks A and B and both are
equal , this is correct or not :-

TASK A -> schedule -> switch_to -> TASK B -> schedule -> switch_to ->
schedule -> switch_to -> TASK A.

Thank you,

Best Regards,

Jaswinder.
--
These are my opinions not 3Di.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Task Switching in Linux
  2001-06-11 20:30 Task Switching in Linux Jaswinder Singh
@ 2001-06-11 22:45 ` george anzinger
  0 siblings, 0 replies; 3+ messages in thread
From: george anzinger @ 2001-06-11 22:45 UTC (permalink / raw)
  To: Jaswinder Singh; +Cc: linux-kernel

Jaswinder Singh wrote:
> 
> In Linux , If we assume that there are only 2 tasks A and B and both are
> equal , this is correct or not :-
> 
> TASK A -> schedule -> switch_to -> TASK B -> schedule -> switch_to ->
> schedule -> switch_to -> TASK A.
> 
Heck no.  TASK A will be run until it either blocks or its time quantum
drops below TASK B's.  It does not matter how many times it calls
schedule(), 'cept its a darn waste of time.

Now, it you call sched_yield() your chances are higher, but still no
guarantee.  If you get the tasks out of SCHED_OTHER sched_yield() will
do the above (if they have the same priority).

George

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Task Switching in Linux
@ 2001-06-12  2:02 Rick Hohensee
  0 siblings, 0 replies; 3+ messages in thread
From: Rick Hohensee @ 2001-06-12  2:02 UTC (permalink / raw)
  To: linux-kernel

Jaswinder Singh wrote:
>
> In Linux , If we assume that there are only 2 tasks A and B and both are
> equal , this is correct or not :-
>
> TASK A -> schedule -> switch_to -> TASK B -> schedule -> switch_to ->
> schedule -> switch_to -> TASK A.
>

If you mean "->" as "specifically calls" then that looks like cooperative
multi-tasking, which is what kernel threads AND the Linux userland
scheduler do. If an in-kernel thread doesn't call schedule, it keeps the
CPU. See the H3rL stuff in ftp://linux01.gwdg.de/pub/cLIeNUX/interim

Rick Hohensee
:; cLIeNUX /dev/tty11  21:00:45   /
:;d -d */
Cintpos/     boot/        device/      incoming/    owner/       temp/
Debian/      command/     floppy/      log/         source/
Linux/       configure/   guest/       lost+found/  subroutine/
NetBSD/      dev/         help/        mounts/      suite/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-06-12  1:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-11 20:30 Task Switching in Linux Jaswinder Singh
2001-06-11 22:45 ` george anzinger
2001-06-12  2:02 Rick Hohensee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).