Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!oliveb!pyramid!prls!philabs!spies!ssdis!gsarff From: gsarff@ssdis.UUCP (gary sarff) Newsgroups: comp.sys.amiga Subject: Re: Amiga UNIX Summary: 2 threads are cheap Message-ID: <142@ssdis.UUCP> Date: 24 Jun 88 21:04:47 GMT References: <23602@hi.unm.edu> <4071@cbmvax.UUCP> Organization: SSDIS-Special Security Department,Internal Security Lines: 32 In article <4071@cbmvax.UUCP>, daveh@cbmvax.UUCP (Dave Haynie) writes: > in article <23602@hi.unm.edu>, erikj@hi.unm.edu (Erik Johannes) says: > > > One of the principal foundations of UNIX is cheap processes, > > Compared to the above, perhaps. But UNIX processes are certainly more > expensive than AmigaOS processes. Which is why they created "threads" > in Mach. Threads are like shared libraries in the sense that they give you an advantage if you have more than 1 process using them. A shared library with only one process using it gives you nothing more than if the library routines were actually in the programs load image. With 2 or more programs you reap an advantage. Same with threads, if you have only 1 thread in a process, it isn't any "cheaper" than a unix process. It still has a process or task control block, a stack, a heap, a place to store its registers when it is context switched etc, just like a heavy process. Only if the process is really executing multiple threads of itself do you get any advantage at all. If I have on my amiga running, 1 word processor, 1 spreadsheet, 1 photon paint, 1 comm program, they are all different processes all single threaded, no advantage is gained. Threads would be much better if one had fork() in an OS like unix, then the OS could just create another thread of the calling process instead of copying the core image again. Threads are nicer yes, but do many amiga programs use them, i.e. are there any multi-threaded "application" programs? -- Gary Sarff {uunet|ihnp4|philabs}!spies!ssdis!gsarff To program is human, to debug is something best left to the gods. "Spitbol?? You program in a language called Spitbol?" The reason computer chips are so small is that computers don't eat much.