From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 03/10] introduce systhread layer Date: Mon, 13 Aug 2012 09:21:30 -0400 Message-ID: References: <87mx23etza.fsf@fleche.redhat.com> <50246659.80200@dancol.org> <9C928EA6-6467-422C-842B-9EA7E37C2A91@raeburn.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1344864108 10216 80.91.229.3 (13 Aug 2012 13:21:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2012 13:21:48 +0000 (UTC) Cc: Tom Tromey , Daniel Colascione , Emacs discussions To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 13 15:21:46 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T0uaS-0001go-RS for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2012 15:21:40 +0200 Original-Received: from localhost ([::1]:47893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0uaR-0004m4-RN for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2012 09:21:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0uaL-0004lp-47 for emacs-devel@gnu.org; Mon, 13 Aug 2012 09:21:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0uaK-0005Nf-5O for emacs-devel@gnu.org; Mon, 13 Aug 2012 09:21:33 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:11063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0uaK-0005NS-14 for emacs-devel@gnu.org; Mon, 13 Aug 2012 09:21:32 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCqqR/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA0QAROIHAW6CZBEA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="195566508" Original-Received: from 76-10-170-145.dsl.teksavvy.com (HELO pastel.home) ([76.10.170.145]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Aug 2012 09:21:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4E1A159305; Mon, 13 Aug 2012 09:21:30 -0400 (EDT) In-Reply-To: <9C928EA6-6467-422C-842B-9EA7E37C2A91@raeburn.org> (Ken Raeburn's message of "Mon, 13 Aug 2012 06:21:24 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152478 Archived-At: >>> I'd also like to do a "no threads" port that will turn most things >>> into no-ops, and have thread-creation fail. I was thinking perhaps >>> I'd make a future (provide 'threads) conditional on threads actually >>> working. Thoughts on this? > Unless there's a platform where the support isn't possible, I'd suggest not > doing this last bit, so that Emacs code (both Lisp and C) can assume threads > are available. Agreed. >> like GNU Pth or Windows fibers in order to avoid OS-level context >> switch overhead. Thread-switching performance won't be good until we can get rid of the unwind&rewind of the let-bindings-stack, so "avoid OS-level context switch overhead" won't bring us any measurable benefit, I think. > Where every I/O operation needs to be rewritten to call some helper function > that do the thread switching? No: for the foreseeable future, the concurrency won't provide any parallelism at all, so thread-switching will only happen at those few points were we already allow async operations (sit-for, accept-process-output and a few more). So there's no need to make wrap all I/O operations. Stefan