develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119897] glob in threads is broken in perl5.18

Thread Previous | Thread Next
From:
Brian Fraser
Date:
September 21, 2013 14:40
Subject:
Re: [perl #119897] glob in threads is broken in perl5.18
Message ID:
CA+nL+nap_6VUFPBh8Kvrte=0BS+TaQMXrCkUFx5L+r8CS3VfFA@mail.gmail.com
On Sat, Sep 21, 2013 at 10:56 AM, Father Chrysostomos via RT <
perlbug-followup@perl.org> wrote:

> On Fri Sep 20 23:45:43 2013, Hugmeir wrote:
> > On Sat, Sep 21, 2013 at 12:19 AM, Father Chrysostomos via RT <
> > perlbug-followup@perl.org> wrote:
> >
> > > On Fri Sep 20 18:05:44 2013, Hugmeir wrote:
> > > > meanwhile, the paradigm in the few CPAN modules that do this[*] is
> > "grab
> > > > the interpreter during BOOT, use that to construct a fake
> > > CLONE_PARAMS, and
> > > > then replace the interpreter with aTHX after MY_CXT_CLONE"
> > > > Which, on top of the previous patch, becomes this:
> > >
> > > It has often bothered me that a CLONE method in pure Perl can’t
> > really
> > > access both interpreters.  I have known about CLONE for a long time,
> > but
> > > had never actually seen it used (or bothered looking).
> > >
> > > If what you have below works, and works reliably (it looks fine to
> > me),
> > > I say go for it.
> > >
> >
> > I wasn't sure if the new tests would work on VMS -- most of the other
> > glob
> > test files have special cases for it -- so I've pushed this as
> > smoke-me/hugmeir/dup_glob_state
>
> Your test assumes that the output will be sorted, but does not even use
> File::Glob on VMS.  I don’t know whether the default glob on VMS
> produces sorted output, and whether you need to sort it.  Alternatively,
> just ‘use File::Glob "glob"’ explicitly, and bypass the globhook
> mechanism (which VMS ignores) altogether.
>

Ah, I see, thanks. From the docs, I had assumed that it always gave sorted
output by default -- perhaps that needs updating to have a clause for VMS
if that's not the case. I've modified the branch to have a 'use File::Glob
"glob"'.


>
> Concerning your earlier Test::More comment and my response, I don’t
> think we actually need to load threads before Test::More if all the
> tests will be coming from one thread.
>

While that's the case right now, the problem is that it's a potential
future gotcha for anyone adding more tests.


>
> >
> >
> > >
> > > Is it possible to write this in a way that is binary-compatible (for
> > > 5.16 and 5.18)?  I believe the fact that the struct below is not
> > public
> > > makes it safe to change it like that.
> > >
> >
> > This I do not know.
> > (I can't find a definition of binary (in)?compatibility perlpolicy or
> > other
> > pods)
>
> As long as XS extensions compiled with 5.18.[10] continue to work with
> 5.18.2, we preserve binary compatibility.  With File::Glob, I don’t
> think we actually have anything to worry about.  I just brought it up
> because I want to backport the change.
>
> BTW, we should probably add a new API to perl for registering clone
> handlers.
>

+50

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About