From owner-freebsd-hackers Sat Sep 9 11:32:49 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from slarti.muc.de (slarti.muc.de [193.149.48.10]) by hub.freebsd.org (Postfix) with SMTP id 162F237B422 for ; Sat, 9 Sep 2000 11:32:45 -0700 (PDT) Received: (qmail 15475 invoked by uid 66); 9 Sep 2000 18:41:38 -0000 Received: from en by slarti with UUCP; Sat Sep 9 18:41:38 2000 -0000 Received: by en1.engelschall.com (Sendmail 8.11.0+) for freebsd-hackers@freebsd.org id e89IW3N43484; Sat, 9 Sep 2000 20:32:03 +0200 (CEST) Date: Sat, 9 Sep 2000 20:31:54 +0200 From: "Ralf S. Engelschall" To: freebsd-hackers@freebsd.org Subject: Re: makecontext & friends ? Message-ID: <20000909203154.A42704@engelschall.com> Reply-To: rse@engelschall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: Engelschall, Germany. X-Web-Homepage: http://www.engelschall.com/ X-PGP-Public-Key: https://www.engelschall.com/ho/rse/pgprse.asc X-PGP-Fingerprint: 00 C9 21 8E D1 AB 70 37 DD 67 A2 3A 0A 6F 8D A5 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <20000909145118.A25823@lamu.hermes.si> you wrote: >> Sure, it can. See my GNU Portable Threads under >> http://www.gnu.org/software/pth/. We have a port under devel/pth, >> too. It bases its user-land threads on ucontext(3) if available or on >> setjmp(3)'s jmp_buf, etc. All without any assembler things. For details >> read my USENIX paper under http://www.gnu.org/software/pth/rse-pmt.ps. >> > I read your paper and it describes the very same technique I was planning > to implement, but the trick with sigaltstack() seems very ugly to me. > [...] Keep in mind that GNU Pth's Autoconf mechanism automatically selects ucontext(3) if available and only uses the sigaltstack(2) trick if no other possibilities exist. As the paper describes in detail, the "ugly trick" is just a _fallback_ approach. That's one reason why I want makecontext(3) on FreeBSD - that we no longer have to use the (15x slower) trick on FreeBSD and instead can directly use a (faster) user-land context mechanism for thread creation and dispatching (although for dispatching the sigjmp_buf approach is usually slightly faster than ucontext because ucontext is a superset of sigjmp_buf). Yours, Ralf S. Engelschall rse@engelschall.com www.engelschall.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message