guile-devel
[Top][All Lists]
Advanced

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

Re: crypt mutex


From: Mikael Djurfeldt
Subject: Re: crypt mutex
Date: Fri, 20 Feb 2004 22:24:37 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> While nosing around the crypt function, I wondered if it ought to have
> a mutex, just in case two threads run it concurrently.

We probably need a policy which regulates when to have and when to not
have a mutex.

Personally, I wouldn't like Guile to have everything thread-safe
"under the hood".  That would be a terrible waste of resources.

I think it is completely OK to specify that certain resources are not
thread safe, and that if a user writes a threaded program which uses
such resources in parallel, he needs to himself supply necessary
mutexes etc.

So, the policy needs to specify where the border between Guile and
user responsibility goes.  In most cases, I would probably draw the
line so that as much as possible of the responsibility is left to the
user with the exceptions that 1. Guile should never segfault due to
misuse in this respect, and, 2. Guile need to have enough thread
safety so that it's reasonably convenient to write parallel programs.

M




reply via email to

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