Re: C question (was Re: [mp2] Our API is not perl thread-safe)

2005-03-28 Thread Stas Bekman
Stas Bekman wrote: Joe Orton wrote: On Sun, Mar 27, 2005 at 08:06:39PM -0500, Stas Bekman wrote: My problem is that I can't see how can I stick a call to MP_CLONE_INSERT_OBJ() inside the mp_xs_APR__Pool_2obj(ptr) wrapper. Since it's usually used as: RETVAL = mp_xs_APR__Pool_2obj(ptr); Is there

Re: C question (was Re: [mp2] Our API is not perl thread-safe)

2005-03-28 Thread Stas Bekman
Joe Orton wrote: On Sun, Mar 27, 2005 at 08:06:39PM -0500, Stas Bekman wrote: My problem is that I can't see how can I stick a call to MP_CLONE_INSERT_OBJ() inside the mp_xs_APR__Pool_2obj(ptr) wrapper. Since it's usually used as: RETVAL = mp_xs_APR__Pool_2obj(ptr); Is there some C trick to hav

Re: C question (was Re: [mp2] Our API is not perl thread-safe)

2005-03-28 Thread Joe Orton
On Sun, Mar 27, 2005 at 08:06:39PM -0500, Stas Bekman wrote: > My problem is that I can't see how can I stick a call to > MP_CLONE_INSERT_OBJ() inside the mp_xs_APR__Pool_2obj(ptr) wrapper. Since > it's usually used as: > > RETVAL = mp_xs_APR__Pool_2obj(ptr); > > Is there some C trick to have

C question (was Re: [mp2] Our API is not perl thread-safe)

2005-03-27 Thread Stas Bekman
We will now have to replace all wrappers like: #define mp_xs_APR__Pool_2obj(ptr) \ sv_setref_pv(sv_newmortal(), "APR::Pool", (void*)ptr) with an additional call to this macro #define MP_CLONE_INSERT_OBJ(namespace, obj) \ {

Re: [mp2] Our API is not perl thread-safe

2005-03-27 Thread Stas Bekman
Stas Bekman wrote: Have done some good but painfully slow progress, now partially covering APR::Table and APR::Pool. In case you care to look here is the work in progress. I wonder if I should branch that since there are going to be *a lot* of additions if this ever works. My main obstacle at t

Re: [mp2] Our API is not perl thread-safe

2005-03-24 Thread Stas Bekman
Stas Bekman wrote: Stas Bekman wrote: [...] First of all we have to separate the objects in two groups: those created by users (1) and those created by Apache/mp2 (2). (1) things which are completely under user control look easy, for example if you create an APR::Table object, we can clone it by

Re: [mp2] Our API is not perl thread-safe

2005-03-23 Thread Ian Holsman
but we're listening On 24/03/2005, at 2:24 PM, Stas Bekman wrote: Stas, who enjoys talking to himself... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ian Holsman Director Netwo

Re: [mp2] Our API is not perl thread-safe

2005-03-23 Thread Stas Bekman
Stas Bekman wrote: [...] First of all we have to separate the objects in two groups: those created by users (1) and those created by Apache/mp2 (2). (1) things which are completely under user control look easy, for example if you create an APR::Table object, we can clone it by copying the table

Re: [mp2] Our API is not perl thread-safe

2005-03-22 Thread Stas Bekman
Stas Bekman wrote: [now take your time to read the Example::CLONE manpage in [1] which explains all the issues and shows possible solutions] To save you the hussle, here is the manpage (but you will probably want to see the code and the tests anyway). __END__ =head1 NAME Example::CLONE - Demonst

Re: [mp2] Our API is not perl thread-safe

2005-03-22 Thread Stas Bekman
Stas Bekman wrote: As I've suspected our API is not perl thread-safe (note that perl's thread-safe definition and the general thread-safe concept have little to do with each other). I've started writing some tests and it's segfaults all over. Here is a very trivial test, which segfault: #!perl -

[mp2] Our API is not perl thread-safe

2005-03-22 Thread Stas Bekman
As I've suspected our API is not perl thread-safe (note that perl's thread-safe definition and the general thread-safe concept have little to do with each other). I've started writing some tests and it's segfaults all over. It all comes to the same old problem of perl cloning the objects when a