On 07/21/2016 02:52 PM, jn...@jnthn.net via RT wrote:
On Fri Jul 15 12:32:30 2016, mt1...@gmail.com wrote:
With Rakudo version 2016.06-234-g0189851 built on MoarVM version
2016.06-9-g8fc21d5
implementing Perl 6.c on a Asus laptop running Fedora 23 I see the
following happen. Running the code below is doing well but when the code
in the critical section gets complex (e.g. '$r += [+] $i, 3, 4, 5, 6, 7,
8, 9, 10;'), the program does not finish. The output of the '+' and '-'
stops but the cpu (2 or 3 of 8) will go to 100% usage (user time, not
system time).


my Semaphore $s .= new(1);

my @p;
my $r;
for ^4000 {
    my $i = $_;

    @p.push: Promise.start( {

        $s.acquire;
        print "+";

        # critical code area
        $r += $i;

        $s.release;
        print "-";
      }
    );
}

This is largely addressed by:

https://github.com/MoarVM/MoarVM/commit/236058a6c8bd91eacf100047831ac77e4ad486b7

However, there is an occasional GC orchestration hang that I'm still looking 
into.
Hi Jonathan,

I'm afraid the test I've created still hangs in rakudo version 2016.07.1-37-g60f256d built on MoarVM version 2016.07-3-gc01472d
implementing Perl 6.c.

This time only 80 threads started and using '$r += [+] $i, 3, 4, 5, 6, 7, 8, 9, 10;' in the critical section.

Btw, a problem in [+] might exist because changing that into '$r += $i + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10;' the code is running flawlessly even with 4000 threads.

Greetings,

Marcel

p.s. email sent to perl6-compi...@perl.org before but now sent also to perl6-bugs-followup

Reply via email to