From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: Redoing conditional thread support Date: 15 Oct 2002 15:00:31 +0200 Sender: guile-devel-admin@gnu.org Message-ID: References: Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034686925 7024 80.91.224.249 (15 Oct 2002 13:02:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2002 13:02:05 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181RKm-0001p8-00 for ; Tue, 15 Oct 2002 15:02:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 181RJr-0003am-00; Tue, 15 Oct 2002 09:01:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 181RJR-0002z8-00 for guile-devel@gnu.org; Tue, 15 Oct 2002 09:00:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 181RJP-0002vy-00 for guile-devel@gnu.org; Tue, 15 Oct 2002 09:00:40 -0400 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10) id 181RJO-0002vH-00 for guile-devel@gnu.org; Tue, 15 Oct 2002 09:00:38 -0400 Original-Received: from dyna224-226.nada.kth.se ([130.237.224.226] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 181RJK-0005Of-00; Tue, 15 Oct 2002 15:00:34 +0200 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 181RJH-0000On-00; Tue, 15 Oct 2002 15:00:31 +0200 Original-To: Marius Vollmer Original-Cc: djurfeldt@nada.kth.se In-Reply-To: Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1558 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1558 Marius Vollmer writes: > I'm about to reorganize our conditional threading stuff so that there > is always a thread API (scm_current_thread, scm_call_with_new_thread, > mutices, condition variables, etc), but when you configure > "--without-threads" you get a null-thread implementation that doesn't > allow the creation of new threads. Thus there will always be only a > single thread. > > This should make it easier to write code that is thread aware but > doesn't require threads, like the thread-aware sigaction function. > > Objections? On the contrary, but Dirk has already made a lot of work on such a reorganization. I think there's a branch in the repository which made a good deal of the way there, if I remember correctly. Dirk? The idea was to use a similar technique as has been used in glib, i.e., a datastructure with a "jump-table" where the initialization routine of a thread library can "plug in" its C level functions. The default values in this datastructure would be the "null" thread implementation. The thread interface would be generic enough to allow both for cooperative threading and pre-emptive threading. This way, users who like coop could link guile together with a "libcoop" library and users who want pthreads could link it with "libguile-pthread" + "libpthread", while users who don't need threading would not link with any external thread library. An important point was that the decision whether to have thread support or not should *not* be made at compile time since this is a decision which should be up to the application developer. This is possible with the "jump-table" approach described above. Dirk and I got a long way towards implementing this. For example, the data structure mentioned above is implemented. I'll try to dig up old documentation + code if you are interested. Best regards, Mikael _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel