netcat wrote:
Hi, internals.
Please send me (post here i mean) a few links about
1. thread safety in general
2. thread saftey in php
3. I'm doing wrapper for librep wich is not thread
safe (so mailing archives say). Do I need to know
something special ?
After doing some googling i found thise for
On Mon, 20 Oct 2003 17:35:30 -0700 (PDT)
Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> True, I should have mentioned that the mutex might have to span an
> entire sequence of calls from open to close or something to that
> effect.
>
> In the specific case of GD, it wouldn't actually be hard to make
True, I should have mentioned that the mutex might have to span an entire
sequence of calls from open to close or something to that effect.
In the specific case of GD, it wouldn't actually be hard to make it
threadsafe. Shane did it before to GD1 and it should probably be done
again for our bu
The question is if this is always enough. Say for example hypothetically
that the GD library saves the state of the currently being manipulated
graphic, it won't be enough to mutex its calls because there's some saved
state in between the calls.
I'm not sure there's a general way to deal with it
nice for that would be some macros (somewhere in zend) which help in
the following way (the ext_skel should generate the code, too):
a) define a global library identifier (for all blocks that should not run
at the same time)
zend_create_mutex(identifier)
b) use some code like:
If the library you are wrapping is not threadsafe, one approach is to
simply not worry about it and just mark your extension as not being safe
to use in a threaded environment. The majority of people use PHP in a
non-threaded environment anyway.
If you want to be nice to the folks who do use P
Hi, internals.
Please send me (post here i mean) a few links about
1. thread safety in general
2. thread saftey in php
3. I'm doing wrapper for librep wich is not thread
safe (so mailing archives say). Do I need to know
something special ?
After doing some googling i found thise for #1
http://www.