guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thread safe functions


From: Andy Wingo
Subject: Re: thread safe functions
Date: Sat, 28 Aug 2010 12:20:31 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Ken,

On Sat 21 Aug 2010 17:57, Ken Raeburn <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]