🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.internals
Article #2378

Re: threads without kernel mods

#2378
From: der Mouse
Date: Sun, 26 May 1991 13:56
26 lines
1686 bytes
In article <1991May20.123423.10388@linus.mitre.org>, jfjr@mbunix.mitre.org (Freedman) writes:

> I need to know about implementing threads or lightweight processes
> without modifying kernel - ie strictly user level implementations.

> How is this accomplished?  Some variant on setjmp/longjmp?

Machine-dependent, perhaps even operating-system-dependent.  I did it
once for 4.3 on a VAX, using SIGALRM to context-switch.  The
implementation depended on knowing some of the internal details of
signal delivery; if I had to do it again I think I'd go about it
differently.  (For one thing, my implementation had no way for a thread
to voluntarily give up the rest of its timeslice....)

Obviously, you will have the problem that any thread blocking in a
syscall blocks all other threads as well.  This may or may not actually
cause you headaches.

If you can build a context switcher, you're most of the way there.  In
fact, if you don't want to ever trigger a context switch from a signal,
that's about all you need.  Dealing with signals can be, errr, fun....

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu
Technical Details
Message-ID: <1991May26.135620.24214@thunder.mcrcim.mcgill.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse
References: <MWM.91May17132439@raven.pa.dec.com> <213@titccy.cc.titech.ac.jp> <1991May20.123423.10388@linus.mitre.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.unix.internals
Subject: Re: threads without kernel mods
Message-ID: <1991May26.135620.24214@thunder.mcrcim.mcgill.edu>
Date: 26 May 91 13:56:20 GMT
References: <MWM.91May17132439@raven.pa.dec.com> <213@titccy.cc.titech.ac.jp> <1991May20.123423.10388@linus.mitre.org>
Organization: McGill Research Centre for Intelligent Machines
Lines: 27