[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crypt mutex
Re: crypt mutex
Mon, 23 Feb 2004 20:12:42 +0100
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)
Mikael Djurfeldt <address@hidden> writes:
> 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.
Yes. Also, what does 'thread-safe' mean, aynway? (This question is
probably just a nother way to ask what you are asking...) For
example, can lists be meaningfully made thread safe?
> 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.
Yes, exactly my view. Also, I would broaden point 1 a bit: we should
also 'fix' functions that can not every be used in a threaded program
without mutexes around them. Like libc getpwent. They might not
segfault, but you can't use them anyway in a threaded program.
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405