On Tue, 16 Mar 2004, Nick Ing-Simmons wrote:

> Andrew Dougherty <[EMAIL PROTECTED]> writes:
> >Whilst trying to build ponie-2 on Solaris 8, I came across the following
> >issue:  In order to use threads, both perl-5.[89].x and parrot need to
> >call some sort of yield() function.
> >
> >In parrot, sched_yield is used; this function is available in the -lrt
> >library, so the solaris hints file adds that in.  There appears to be no
> >way to override this from the Configure.pl command line.
> >
> >In perl, the plain yield() function is used; this function is available in
> >the standard C library, so -lrt is not used.  (Indeed, it's not even
> >mentioned in Configure.)  The hints/solaris_2.sh file unconditionally sets
> >sched_yield='yield' (bad hints file! I'll supply a patch for that
> >separately.)
> >
> >Underneath it all, it doesn't matter -- both functions are the same on
> >Solaris -- but leaving things the way they are gives the following error
> >message for ponie-2:
>
> The worry might be that adding -lrt may have other side effects.
> Alan?

Alan's the one who recommended perl not bother with -lrt since it didn't
add anything useful.  He removed it as part of a larger Solaris
loading/linking cleanup.  I don't think there were any conflicts with
stuff in -lrt at the time, but avoiding dragging in unnecessary libraries
is usually a good idea all around, so his approach looks fine to me.

As far as I can tell, both parrot and perl have taken a sensible approach
to dealing with sched_yield(); they just don't play well together, and
neither is easily overrideable from the Configure command line.  Since
each is ultimately supposed to be able to be embedded and extended, I
think each needs to be a bit more flexible.

> >Longer term, it'd probably be good for parrot to have yield() vs.
> >sched_yield() set by some Configure.pl-time variable. For now, it would
> >likely be sufficient to simply key off of perl5's $Config{sched_yield}.
> >
> >Similarly, perl's Configure/hints combination ought to be a bit more
> >flexible about yield() vs. sched_yield().  This would help make perl
> >slightly more flexible in adapting to being extended or embedded.

I can patch perl5's Configure/hints combination (and hence suggest a
work-around for ponie), but I think someone else ought to look at the
parrot side of things too.

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to