[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crypt mutex
From: |
Mikael Djurfeldt |
Subject: |
Re: crypt mutex |
Date: |
Mon, 23 Feb 2004 20:22:19 -0500 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Andreas Voegele <address@hidden> writes:
> I'd also prefer a minimal policy. But what do you do if operating
> system A provides the reentrant function foo_r() while operating
> system B provides foo() only? The Scheme procedure "foo" should
> behave the same on both systems.
>
> I think that there are four options:
>
> 1. Use foo_r() if available, otherwise protect foo() with a mutex
> internally.
>
> 2. Use foo() and tell the user to protect the Scheme procedure in
> threaded programs. It doesn't make sense to use foo_r() in this
> scenario.
>
> 3. Provide two Scheme procedures: "foo" and a thread safe version
> "foo-r". "foo-r" uses foo() and a mutex if foo_r() isn't
> available.
>
> 4. Provide two modules, a normal and a thread safe version. A command
> line switch could be used to request thread safety. IMHO this
> would be useful for stuff like the POSIX and networking procedures.
Of these options I think 3 and 4 would add more complexity than is
payed for, and prefer 1 above 2 if foo_r isn't too uncommon.
M