From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9273 Path: news.gmane.org!not-for-mail From: u-uy74@aetey.se Newsgroups: gmane.linux.lib.musl.general Subject: Re: setcontext/getcontext/makecontext missing? Date: Fri, 5 Feb 2016 10:58:35 +0100 Message-ID: <20160205095835.GH25193@example.net> References: <87199830-7260-4E33-B3A6-BE15AF610BCE@akamai.com> <20160204145409.GB9915@port70.net> <20160204154137.GN9349@brightrain.aerifal.cx> <20160204162246.GF25193@example.net> <20160204192403.GR9349@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1454666354 3843 80.91.229.3 (5 Feb 2016 09:59:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Feb 2016 09:59:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9286-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 05 10:59:14 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aRdAT-00025d-R3 for gllmg-musl@m.gmane.org; Fri, 05 Feb 2016 10:59:10 +0100 Original-Received: (qmail 22338 invoked by uid 550); 5 Feb 2016 09:59:01 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 22317 invoked from network); 5 Feb 2016 09:59:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fripost.org; h= in-reply-to:content-disposition:content-type:content-type :mime-version:references:message-id:subject:subject:from:from :date:date; s=20140703; t=1454666330; x=1456480731; bh=joFNGByRD nazA9WtOP+i9k5TPu3l64u4rx9Ni+K0Cm4=; b=Cyk38W25xoCJesQ0IpPuPzGg9 Foz+dDYdvAmHrhwisisYiDxapIFsY07wA55LTALwC3gfyrZfrqhDyqzVOsSuQMev 1c3bQ/f21KFkW59aHeelw5rTEIke7XvIcIRufCWFbkEaCHnyD9F9lszIVJm4N/uo H+Q3BMNyRJgNem/8rA= X-Virus-Scanned: Debian amavisd-new at fripost.org Content-Disposition: inline In-Reply-To: <20160204192403.GR9349@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:9273 Archived-At: On Thu, Feb 04, 2016 at 02:24:03PM -0500, Rich Felker wrote: > > Pthreads feels like an overkill, hardly efficient when all one needs > > is cooperative threading designed from the beginning to fit in one > > process. > the comparison is not between pure-userspace switching and having the > kernel involved, but between a SYS_rt_sigprocmask syscall and a > voluntary context switch between threads in the same process. The > latter is extremely light and comparable to some of the cheapest > syscalls, so I suspect the performance difference between ucontext and > threads is negligible. Thanks for pointing this out, if rt_sigprocmask can not be skipped then indeed a switch becomes much more expensive. > Given that there are a lot of other good > reasons you should be using threads instead of ucontext, I think the > matter is pretty clear. Sure, the API was not exactly well thought-out. Still I'd like to have a lighweight choice when it is enough. This is of course offtopic for musl, given that there is no reasonable standard/specification for the purpose. Regards, Rune