Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!aplcomm!capd.jhuapl.edu!waltrip From: waltrip@capd.jhuapl.edu Newsgroups: comp.sys.next Subject: Re: Don't believe that SunOS Threads are equivalent to Mach's Message-ID: <1991May7.131146.1@capd.jhuapl.edu> Date: 7 May 91 18:11:46 GMT References: <9105040321.AA00869@lhs.woodside.ca.us> <1991May6.231923.19489@cs.ubc.ca> Sender: news@aplcomm.JHUAPL.EDU Organization: CAPVAX, JHU/APL Lines: 29 In article <1991May6.231923.19489@cs.ubc.ca>, sritchie@cs.ubc.ca (Stuart Ritchie) writes: > In article scott@nic.gac.edu (Scott Hess) writes: [...material deleted...] > > What's being debated here is kernel supported vs. user level > supported threads. > > I want to use user level supported threads > for efficiency: trapping to operations in the kernel is at least > 10 times more expensive than a procedure call. (Has anybody > measured this in practice? I'm interested in hearing about it.) Hmmm. I haven't but it's an interesting question alright. I would suspect that "user level" threads are implemented as coroutines and that longjmp/setjump are used when passing context from one thread to another voluntarily. When done via a user-written scheduler which depends on a timer routine, a kernel trap (the alarm system service) is performed anyway. So, if your thread(s) never blocks and you don't write a scheduler, I suspect "user level" threads might be somewhat more efficient. Unless I absolutely needed the efficiency, however, I'd stick with Mach threads where I could. c.f.waltrip Internet: Opinions expressed are my own.