[OpenAFS] Re: AFS Perl module and threaded Perl

Russ Allbery rra@stanford.edu
Fri, 03 Dec 2004 22:05:50 -0800


Chaskiel M Grundman <cg2v@andrew.cmu.edu> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> Can you tell me what version of OpenAFS this library first became
>> available in?

> All versions of openafs are able to build these libraries in archive
> (.a) form, but they are not built on every platform (only platforms that
> afs supports pthreads on. (at the very least, it is not built on netbsd
> 1.x or old darwin [old is < 7.0. I do not remember what macos x release
> that corresponds to.])

It sounds like the right thing to do will be to see if Perl is built with
threading.  If so, die if we're not building with OpenAFS.  If we have
both threading and OpenAFS, switch to the alternate library list.
Continue to use the regular library list otherwise, just because it's
known to work.

Maybe down the road the library interface can become more consistent.

> This reference is a result of the use of libvolser and libbos, which are
> not pthread-aware. The pthread-aware libraries cannot export this
> interface, since pthread-rx does not use it, and because it involves
> unprotected access to global variables. 'we' probably should not support
> mixing and matching pthread and non-pthread libraries like this.

Ah, okay.  I'm guessing that unless the user actually uses threaded Perl
(something that's perilous at best even without using random XS modules),
Perl will serialize everything and the result will be that these unsafe
accesses won't actually matter.

> It's unfortunate that I didn't polish the setcontext-based-LWP code I
> was working on (rt.central.org #1280) last year and try to get it into a
> release. setcontext and swapcontext don't have the
> _longjmp_unwind/__pthread_cleanup_upto craziness and would have
> presumably continued to work in a pthread environment

Yeah, that would be really nice.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>