Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool2.mu.edu!uwm.edu!linac!att!pacbell.com!ucsd!sdcc6!beowulf!djohnson From: djohnson@beowulf.ucsd.edu (Darin Johnson) Newsgroups: comp.sys.amiga.misc Subject: Re: True Multitasking Message-ID: <15750@sdcc6.ucsd.edu> Date: 19 Jan 91 01:47:13 GMT References: <1991Jan18.055614.13889@zorch.SF-Bay.ORG> <42149@nigel.ee.udel.edu> Sender: news@sdcc6.ucsd.edu Organization: CSE Dept., UC San Diego Lines: 21 Nntp-Posting-Host: beowulf.ucsd.edu In article <42149@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes: >Please tell me the difference between coroutines and lightweight >processes. I always thought that lightweight processes were two >'tasks' (i.e., independant program counters) sharing the same address >space. Lightweight processes (LWP) and co-routines (CR) have much in common, and some people blur the definition. Usually however, LWP's have the ability to context switch anywhere, like any process. CR's need only change context at IO, semaphores, and other special calls. CR's are a language construct, whereas LWP's are an OS construct. CR's require much less OS and machine support, but require more compiler support (co-routines share the same stack, global vars, etc). Actually, to avoid confusion, compiler support is not needed. CR's can be done in assembler without much fuss - device drivers often do this (usually when LWP's are unavailable). -- Darin Johnson djohnson@ucsd.edu - Political correctness is Turing undecidable.