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: Concurrency Date: Sun, 28 Mar 2010 16:03:37 -0400 Message-ID: References: <27349166.post@talk.nabble.com> <27560255.post@talk.nabble.com> <4B754E74.8060705@swipnet.se> <27563610.post@talk.nabble.com> <4B7564C7.1010309@swipnet.se> <27564728.post@talk.nabble.com> <4B756FB7.3050202@swipnet.se> <87k4ui4gik.fsf@lola.goethe.zz> <27566385.post@talk.nabble.com> <87wryi2sjd.fsf@lola.goethe.zz> <27585994.post@talk.nabble.com> <87k4ucdmwh.fsf@stupidchicken.com> <87d3zweq4e.fsf@master.homenet> <87y6hg1h4a.fsf@thor.thematica.it> <87tys3j9fa.fsf@lifelogs.com> <87eij6tqmu.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269806639 32174 80.91.229.12 (28 Mar 2010 20:03:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 20:03:59 +0000 (UTC) Cc: Ted Zlatanov , emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 28 22:03:51 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nvyi6-0005QK-ND for ged-emacs-devel@m.gmane.org; Sun, 28 Mar 2010 22:03:51 +0200 Original-Received: from localhost ([127.0.0.1]:55727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nvyi6-0004Li-0w for ged-emacs-devel@m.gmane.org; Sun, 28 Mar 2010 16:03:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nvyhy-0004L9-Rg for emacs-devel@gnu.org; Sun, 28 Mar 2010 16:03:42 -0400 Original-Received: from [140.186.70.92] (port=57782 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nvyhx-0004Ji-2I for emacs-devel@gnu.org; Sun, 28 Mar 2010 16:03:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nvyhv-00053O-GF for emacs-devel@gnu.org; Sun, 28 Mar 2010 16:03:40 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27030 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nvyhv-00053I-BA for emacs-devel@gnu.org; Sun, 28 Mar 2010 16:03:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAIZTr0tMCqKh/2dsb2JhbACbKHK8UIUBBIse X-IronPort-AV: E=Sophos;i="4.51,323,1267419600"; d="scan'208";a="59481933" Original-Received: from 76-10-162-161.dsl.teksavvy.com (HELO pastel.home) ([76.10.162.161]) by ironport2-out.pppoe.ca with ESMTP; 28 Mar 2010 16:03:37 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9E6C985F0; Sun, 28 Mar 2010 16:03:37 -0400 (EDT) In-Reply-To: (Tom Tromey's message of "Sun, 28 Mar 2010 13:40:59 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122811 Archived-At: > Here's a quick rundown of the new primitives. > (run-in-thread FUNC) > Take a no-argument function as an argument. > Makes a new thread and calls the function. > (with-new-thread FORM) > A convenience macro that takes a form, wraps it in a lambda, > and calls run-in-thread. > (yield) > Yield control. > Emacs has semi-cooperative threading. Thread switches happen during > I/O or by explicit yield. > (make-mutex) > Make a new lock and return it > (mutex-lock MUTEX) > Acquire a mutex. If already held by this thread, returns. I.e. it's a "recursive/reentrant mutex". > If the mutex is held by some other thread, blocks until it is > available. > (mutex-unlock MUTEX) > Release the lock. Sounds good. Could someone complete the above with a description of how let-bindings work (and/or how they interact with buffer-local bindings)? Also, a list of bugs/problem/issues would be handy, Stefan PS: And place this info in a file in the `concurrent' branch.