unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Ken Raeburn <raeburn@raeburn.org>
Cc: guile-devel Development <guile-devel@gnu.org>
Subject: Re: thread safe functions
Date: Sat, 28 Aug 2010 12:20:31 -0700	[thread overview]
Message-ID: <m3lj7q35og.fsf@unquote.localdomain> (raw)
In-Reply-To: <8C8EEFE6-77CA-42E7-A2FB-9CEF4E83CDFF@raeburn.org> (Ken Raeburn's message of "Sat, 21 Aug 2010 20:57:46 -0400")

Hi Ken,

On Sat 21 Aug 2010 17:57, Ken Raeburn <raeburn@raeburn.org> writes:

> On Aug 18, 2010, at 11:56, Andy Wingo wrote (quoting the manual):
>> Thus, you need to put in additional synchronizations when multiple
>> threads want to use a single hashtable, or any other mutable Scheme
>>    object.
>
> Unfortunately this applies to some internals of the implementation too.
> For example, "set-object-property!" and friends use a hash table and
> assoc lists internally.

Fixed, thanks.

> scm_c_issue_deprecation_warning and scm_c_register_extension don't look
> thread-safe to me (in the sense described above).

Fixed also.

> That's just from a spot check; I'm not even trying to be thorough.

I await your more thorough check :)

> And don't get me going on memory ordering models....

I'm interested!

> To be honest, I wouldn't trust libguile in a multithreaded application
> without much more careful analysis, not just of the code, but of the
> assumptions being made and whether they're actually valid for various
> processors (not just the relatively friendly x86) and compilers.
> Without that sort of analysis, I think "use mutexes everywhere" is the
> only safe approach, and libguile certainly isn't doing that.

I think we agree, but I prefer to paint this in a more optimistic
light -- that things are mostly there, but bugs are possible. Bug fixes
are also possible :)

Cheers,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2010-08-28 19:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100805112743.GA1671@securactive.net>
     [not found] ` <m3vd77vrs0.fsf@unquote.localdomain>
2010-08-22  0:57   ` thread safe functions Ken Raeburn
2010-08-28 19:20     ` Andy Wingo [this message]
2010-08-29  1:33       ` Ken Raeburn
2011-02-10 22:19         ` Andy Wingo
2011-02-15 16:00           ` Ken Raeburn
2011-05-23 20:25             ` Andy Wingo
2011-02-15 17:18           ` Ken Raeburn
2011-05-23 20:38             ` Andy Wingo
2011-05-24 20:57           ` Andy Wingo

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=m3lj7q35og.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=raeburn@raeburn.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).