From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: C level mutices and condition variables Date: 27 Oct 2002 01:33:31 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <87adl0pygk.fsf@zagadka.ping.de> References: <87vg3pot7a.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035675236 5698 80.91.224.249 (26 Oct 2002 23:33:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 26 Oct 2002 23:33:56 +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 185aRG-0001Tl-00 for ; Sun, 27 Oct 2002 01:33:55 +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 185aRf-0005e8-00; Sat, 26 Oct 2002 19:34:19 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 185aQw-0003im-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 19:33:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 185aQu-0003ha-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 19:33:33 -0400 Original-Received: from mail.dokom.net ([195.253.8.218]) by monty-python.gnu.org with esmtp (Exim 4.10) id 185aQt-0003hW-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 19:33:32 -0400 Original-Received: from dialin.speedway42.dip231.dokom.de ([195.138.42.231] helo=zagadka.ping.de ident=qmailr) by mail.dokom.net with smtp (Exim 3.32 #2) id 185aRX-0001aX-00 for guile-devel@gnu.org; Sun, 27 Oct 2002 01:34:11 +0200 Original-Received: (qmail 14648 invoked by uid 1000); 26 Oct 2002 23:33:31 -0000 Original-To: Neil Jerram 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:1613 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1613 Neil Jerram writes: > - Why would you want "to have SCM data in a scm_t_mutex"? - isn't the > data that you are protecting access to normally a separate variable > (or set of variables) from the mutex itself? I was thinking about data that is needed to implement the mutex itself. It would be nice to be able to use SCM values, I'd say, just because a SCM string as the mutex name is nicer than a C string. Concretely, I wanted to use SCM lists to implement the waiting queue (to add fairness to POSIX mutices), mostly because SCM lists are already there and why shouldn't I use them then? > - What do you mean by not abstract enough? You will declare scm_t_mutex variables and thus the size of the scm_t_mutex structure can not change. When we want to select mutex implementations at run-time, that might be a (small) problem. In any case, I think it is better to hide mutices behind SCM values, just as other data structures. > - In "tell them to use the Scheme level mutices", who is "them", and The people who use scm_t_mutex etc now. > would it be possible for them to use Scheme mutexes from C code, or > are you saying that people who need mutexes must code in Scheme? They can code in C. Instead of scm_t_mutex my_mutex; scm_mutex_init (&my_mutex); scm_mutex_lock (&my_mutex); it would be SCM my_mutex = scm_make_mutex (); scm_lock_mutex (my_mutex); -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel