unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mikael Djurfeldt <mdj@mit.edu>
Cc: djurfeldt@nada.kth.se
Subject: Re: pthread fast mutexes
Date: Mon, 23 Feb 2004 17:22:47 -0500	[thread overview]
Message-ID: <xy7y8qtcu6g.fsf@chunk.mit.edu> (raw)
In-Reply-To: <xy73c91e9k3.fsf@chunk.mit.edu> (Mikael Djurfeldt's message of "Mon, 23 Feb 2004 17:05:16 -0500")

Mikael Djurfeldt <mdj@mit.edu> writes:

> Therefore, fast mutexes are consistent with the requirements of the
> interface, and they are, well, fast...

Actually, there's more to it than that:

Guile has two kinds of mutexes:

1. The ones you get with (make-mutex)

   These are efficient.  They are also used internally and in the
   application C API.  Therefore, any speed penalty on these will have
   a global effect on all programs in a Guile with threading
   activated.  I actually did a benchmark between fast and normal
   mutexes and there is a significant difference in run-time for
   non-threaded programs in such a Guile.

2. The ones you get with (make-fair-mutex)

   These are fair, recursive and error checking.
   Simply put: These are the mutexes with all bells and whistles.

   Try (unlock-mutex (make-fair-mutex))

Given that we really need very efficient mutexes in Guile internals,
and that one probably would like to be able to use these from the
Scheme level if we also provide a "safe" alternative, I really
wouldn't like to abstain from the "fast" mutexes of pthreads.

If people think it is a really bad idea not to have better error
checking on the mutexes you get from (make-mutex), one possibility is
to make the following name substitutions:

make-mutex      --> make-fast-mutex
make-fair-mutex --> make-mutex

M


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2004-02-23 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-23 21:16 pthread fast mutexes Kevin Ryde
2004-02-23 22:05 ` Mikael Djurfeldt
2004-02-23 22:22   ` Mikael Djurfeldt [this message]
2004-02-23 23:46     ` Kevin Ryde
2004-02-24  0:02       ` Mikael Djurfeldt
2004-02-28 20:18         ` Kevin Ryde
2004-03-20 22:51     ` Marius Vollmer
2004-02-23 22:33   ` Kevin Ryde
2004-02-24  1:17     ` Mikael Djurfeldt
2004-03-20 22:51       ` 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=xy7y8qtcu6g.fsf@chunk.mit.edu \
    --to=mdj@mit.edu \
    --cc=djurfeldt@nada.kth.se \
    /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).