At 08:09 PM 5/3/2001 -0400, Benjamin Sugars wrote:
>On Thu, 3 May 2001, Chris Stith wrote:
>
> > Really, it does help to let the user know, but wouldn't it be
> > better to be able to declare an XS module to be thread safe in the
> > Perl program calling it or perhaps in the XS itself? This would
> > require YAFC (yet another function call), but it would be a way to
> > control whether or not perl will single-thread the calls.
> >
> >     use Foo;
> >     threadsafe Foo;
> >
> > It's ugly, but it would allow an easy way to let perl know whether
> > it can safely treat calls to an XS based module as reentrant.
>
>Would not the module itself have a better idea about thread safety than
>the calling environment?

Probably, yes.

>But I don't see how this helps.  Simply serializing calls into a
>non-thread-safe library doesn't make it thread-safe.  Or perhaps I'm
>misunderstanding your suggestion?

Serializing calls into a non-thread-safe library will often be enough. Not 
always, mind, but quite often.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to