From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giuseppe Scrivano Newsgroups: gmane.emacs.devel Subject: Re: multi-threaded Emacs Date: Fri, 05 Dec 2008 19:37:05 +0100 Message-ID: <87wseefoz2.fsf@master.homenet> References: <28ea42436516c786f86df564cafe07e3@vanilla.net.mt> <87prk8mhg9.fsf@vanilla.net.mt> <87oczq69cn.fsf@vanilla.net.mt> <87prk64ilv.fsf@vanilla.net.mt> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228502268 17946 80.91.229.12 (5 Dec 2008 18:37:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2008 18:37:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Li Lin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 19:38:54 2008 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.50) id 1L8fZj-00020g-Dg for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2008 19:38:51 +0100 Original-Received: from localhost ([127.0.0.1]:36268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8fYY-0005Qi-P9 for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2008 13:37:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8fYT-0005PD-OA for emacs-devel@gnu.org; Fri, 05 Dec 2008 13:37:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8fYR-0005ND-7C for emacs-devel@gnu.org; Fri, 05 Dec 2008 13:37:32 -0500 Original-Received: from [199.232.76.173] (port=48982 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8fYR-0005MF-1U for emacs-devel@gnu.org; Fri, 05 Dec 2008 13:37:31 -0500 Original-Received: from jack.mail.tiscali.it ([213.205.33.53]:35472) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L8fYP-0008Ix-UM for emacs-devel@gnu.org; Fri, 05 Dec 2008 13:37:30 -0500 Original-Received: from master.homenet (84.222.166.119) by jack.mail.tiscali.it (8.0.022) id 48F748100271B242; Fri, 5 Dec 2008 19:37:12 +0100 Original-Received: from gscrivano by master.homenet with local (Exim 4.69) (envelope-from ) id 1L8fY1-00012F-V0; Fri, 05 Dec 2008 19:37:05 +0100 In-Reply-To: <87prk64ilv.fsf@vanilla.net.mt> (Li Lin's message of "Fri, 05 Dec 2008 18:50:04 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:106618 Archived-At: Personally I don't think there is need to use a library that at the moment is usable only on an architecture, it will be a serious portability problem for Emacs (that probably after "Hello World" is the most portable program out there). All we need for a multi-threaded Emacs can be done quite easily with pthreads. Giuseppe Li Lin writes: > SMASH has many different implementations. Basically, we create one > kernel thread for each CPU(or core) in which a user-level thread > scheduler runs, and the thread is bounded to the corresponding CPU. The > context switches among user-level threads are done though a explicit > call to the function cthread_yield(). However, it is the native > scheduler that manages the kernel threads. > So on uniprocessor machines, it is purely cooperative, on multi-CPU(or > -core) machines it is a mixture of cooperative and preemptive > threads. However, it is not difficult to modify it so that on > uniprocessor machine we still have more than one kernel threads. > I attached Kurt's thesis about SMASH. Although a lot of implementation > details has changed, his orginal thesis is still a good reference. > The attachment is a DVI file. If you can read it, then I can send you > the latex source of it, but you have to compile it by yourself.