Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Splitting large array for threads.

by Anonymous Monk
on Jun 16, 2014 at 21:39 UTC ( #1090078=note: print w/replies, xml ) Need Help??


in reply to Splitting large array for threads.

The latest version of threads distributed with Perl v5.20 states:

WARNING

The "interpreter-based threads" provided by Perl are not the fast, lightweight system for multitasking that one might expect or hope for. Threads are implemented in a way that make them easy to misuse. Few people know how to use them correctly or will be able to provide help.

The use of interpreter-based threads in perl is officially discouraged.

I believe this is the relevant discussion on P5P.

You may want to look into doing this with multiple processes instead. A central manager process could take responsibility of handing out reasonably-sized chunks out to the workers. See for example fork or Parallel::ForkManager, as well as perlipc.

Replies are listed 'Best First'.
Re^2: Splitting large array for threads.
by Anonymous Monk on Jun 17, 2014 at 03:17 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090078]
help
Chatterbox?
[shmem]: Discipulus: the <<>> operator is quite new, it is in perl5.24 for instance
[Discipulus]: ah! thanks shmem it works in strawberry 5.24
[shmem]: ah. Introduced in 5.22.0, see perl5220delta
[Discipulus]: if so the previous error is a bit misleading, anyway
[shmem]: well, previous to that << was always treated as the left-shift operator
[Eily]: or the here-doc operator
[Eily]: which is actually how it is parsed in this case
[shmem]: older versions of perl can't guess that "use of <<>> may be implemented someday" :D
Discipulus how much wise my brothers are? ;=)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-07-21 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (320 votes). Check out past polls.