unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: guile-devel@gnu.org
Subject: Re: C level mutices and condition variables
Date: 27 Oct 2002 01:33:31 +0200	[thread overview]
Message-ID: <87adl0pygk.fsf@zagadka.ping.de> (raw)
In-Reply-To: <m3smysga9q.fsf@laruns.ossau.uklinux.net>

Neil Jerram <neil@ossau.uklinux.net> 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


  reply	other threads:[~2002-10-26 23:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-26 20:12 C level mutices and condition variables Marius Vollmer
2002-10-26 21:28 ` Neil Jerram
2002-10-26 23:33   ` Marius Vollmer [this message]
2002-10-27  7:40     ` Neil Jerram
2002-10-27 12:37       ` Marius Vollmer
2002-11-11 22:05 ` Thread interface issues (was Re: C level mutices and condition variables) Mikael Djurfeldt
2002-11-12 22:37   ` GC & threads (was: Thread interface issues) Han-Wen Nienhuys
2002-11-12 23:09   ` Thread interface issues (was Re: C level mutices and condition variables) Neil Jerram
2002-11-22 21:27     ` Marius Vollmer
2002-11-23 20:55       ` Thread interface issues Mikael Djurfeldt
2002-11-24 10:27         ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87adl0pygk.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).