Re: [PHP-DEV] request for thread safety advice

2003-10-22 Thread netcat
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

Re: [PHP-DEV] request for thread safety advice

2003-10-21 Thread Pierre-Alain Joye
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

Re: [PHP-DEV] request for thread safety advice

2003-10-20 Thread Rasmus Lerdorf
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

Re: [PHP-DEV] request for thread safety advice

2003-10-20 Thread Andi Gutmans
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

Re: [PHP-DEV] request for thread safety advice

2003-10-20 Thread Uwe Schindler
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:

Re: [PHP-DEV] request for thread safety advice

2003-10-20 Thread Rasmus Lerdorf
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

[PHP-DEV] request for thread safety advice

2003-10-20 Thread netcat
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.