Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tnc!m0154 From: m0154@tnc.UUCP (GUY GARNETT) Newsgroups: comp.sys.amiga.misc Subject: Re: True Multitasking Message-ID: <672@tnc.UUCP> Date: 22 Jan 91 17:11:10 GMT References: <1991Jan18.055614.13889@zorch.SF-Bay.ORG> <42149@nigel.ee.udel.edu> Reply-To: m0154@tnc.UUCP (GUY GARNETT) Organization: The Next Challenge, Fairfax, Va. Lines: 37 This is my understanding of the "threads" or "lightweight processes" issue; feel free to correct me if I am not up to date on the terminology. "threads", or "lightweight processes" are separate execution traces which share the address spaces with one or more other processes, regardless of the other processes weight. They were designed to allow many of the simpler multitasking jobs (like re-drawing the screen or recalculating the spreadsheet) to be done with lower overhead. They are implemented in OS/2 and perhaps the Mach kernal. "coroutines" are the individual processes in a cooperatinve multitasking environment. The main program coordinates the activity of multiple subroutines, so that the system multitasks effectively. Unlike preemptive multitasking, cooperatinve multitasking places a demand on the programmer to ensure that the system operates efficently. One improperly programmed routine can cause the whole system to fall apart without really intending to. As I understand it, the Amiga does not have "threads" or "lightweight processes". The Amiga does make a distinction between "processes" and "tasks". A process could be described as a task that is known to AmigaDOS (Amiga EXEC handles multitasking, at a level below AmigaDOS). Processes have a current directory, standard input and output streams, and some other things which tasks do not. One time I explained this to a Unix programmer, and his initial response was "Oh! Tasks are a kind of daemon, then? ... (Well sort of). Although all of the tasks and processes on the Amiga share an address space, it is not intended that there be multiple execution traces through the same code and data (with the well-defined exception of certian operating system code). You *CAN* do it, but you do not get the same benefits that threads get - the operating system overhead is the same, and writing code to work this way adds its own overhead. Wildstar