Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with autobox on Windows #38

Closed
iynehz opened this issue May 15, 2023 · 3 comments
Closed

Does not work with autobox on Windows #38

iynehz opened this issue May 15, 2023 · 3 comments

Comments

@iynehz
Copy link

iynehz commented May 15, 2023

I've raise this ticket chocolateboy/autobox#16 to autobox. But at this moment I am not sure whether it's an issue on autobox side or Parallel::ForkManager side.

Also paste the demo code here. Windows 11 22H2, Strawberry Perl 5.32.1

use Parallel::ForkManager;

# comment out this line and it becomes good.
use autobox;

my $pm = Parallel::ForkManager->new(3);

$pm->run_on_finish(
    sub {
        my ( $pid, $exit_code, $ident, $exit_signal, $core_dump, $returned ) = @_;
        print "Child with ", $returned->{id}, " finished.\n";
    }
);

LOOP:
foreach my $id (0 .. 10) {
    my $pid = $pm->start and next LOOP;
    print "Starting with $id \n";
    my $return_data = {};
    $return_data->{id} = $id;
    $pm->finish( 0, $return_data );
}
$pm->wait_all_children;
print "is this gonna work???\n";
@yanick
Copy link
Collaborator

yanick commented May 15, 2023

Seems to work for me. What error are you getting?

⥼ perl -MParallel::ForkManager\ 999
Parallel::ForkManager version 999 required--this is only version 2.02.
 
⥼ perl -Mautobox\ 999
autobox version 999 required--this is only version v3.0.1.

⥼ perl -V
Summary of my perl5 (revision 5 version 30 subversion 0) configuration:

⥼ perl foo.pl
Starting with 0 
Starting with 1 
Starting with 2 
Child with 2 finished.
Child with 1 finished.
Child with 0 finished.
Starting with 4 
Starting with 3 
Starting with 5 
Child with 4 finished.
Child with 3 finished.
Child with 5 finished.
Starting with 6 
Starting with 7 
Starting with 8 
Child with 6 finished.
Child with 8 finished.
Child with 7 finished.
Starting with 10 
Starting with 9 
Child with 10 finished.
Child with 9 finished.
is this gonna work???

@iynehz
Copy link
Author

iynehz commented May 17, 2023

Seems to work for me. What error are you getting?

It ends after Parallel::ForkManager starts, like this,

>perl foo.pl
Starting with 0
Starting with 1
Starting with 2

>echo %errorlevel%
-1073741819

Strangely I tried multiple combinations and all got the same issue.

  • Windows 11 22H2, Strawberry Perl 5.32.1
  • Windows 11 22H2, Strawberry Perl 5.30.0
  • Windows 10 21H2, Strawberry Perl 5.30.0

And actually I got the issue reported from this ticket to my library iynehz/perl5-Chart-GGPlot#29, and I narrowed it down to autobox. So you see it's not only me.

@iynehz
Copy link
Author

iynehz commented Jun 17, 2023

Close this ticket, as it's an issue on autobox side, according to chocolateboy and Mario Roy.

@iynehz iynehz closed this as completed Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants