/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® one core |
Each table row shows performance measurements for this Perl program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500,000 | Failed | 353 |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read thread-ring benchmark to see what this program should do.
This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux
Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
For this to work on 32bit we have to set ulimit -s 100
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # contributed by Richard Cottrill use strict; use warnings; use threads; use threads::shared; use Thread::Semaphore; my $numThreads :shared; my $data :shared; my $result :shared; my @mutex :shared; $numThreads = 503; sub thr_func { my ($nextThread, $thr_name); $thr_name = threads->tid(); threads->detach(); if ($thr_name == $numThreads) { $nextThread = 1; } else { $nextThread = $thr_name + 1; } while (1) { $mutex[$thr_name]->down(); if ($data) { $data = --$data; $mutex[$nextThread]->up(); } else { $result = $thr_name; $mutex[0]->up(); } } } $data = $ARGV[0]; $mutex[0] = new Thread::Semaphore(0); { for (1 .. $numThreads) { $mutex[$_] = new Thread::Semaphore(0); threads->create(\&thr_func); } } $mutex[1]->up(); $mutex[0]->down(); print "$result\n"; exit(0);
Thu, 23 May 2013 10:11:52 GMT COMMAND LINE: /usr/local/src/perl-5.18.0_no_ithreads_no_multi/bin/perl threadring.perl 500000 PROGRAM FAILED PROGRAM OUTPUT: This Perl not built to support threads Compilation failed in require at threadring.perl line 9. BEGIN failed--compilation aborted at threadring.perl line 9.