Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^2: How to bucket a Hash

by techman2006 (Beadle)
on Nov 27, 2013 at 07:29 UTC ( #1064566=note: print w/replies, xml ) Need Help??

in reply to Re: How to bucket a Hash
in thread How to bucket an Hash

That was a test program and it didn't take care of the all the cases :). Thanks for fixing that issue.

As I was looking to different solutions which can be used while assigning jobs to multiple threads. As I want a fixed size queue is assigned to each thread. As the job items are present in a HASH, I was looking a method through which this slicing can be done on a faster way as the total keys can be high.

Replies are listed 'Best First'.
Re^3: How to bucket a Hash
by Random_Walk (Prior) on Nov 27, 2013 at 09:41 UTC

    Why do you want a fixed work unit size for each thread? Given the vagaries of multitasking, some thread is sure to finish a fixed length task before another doing the same size task. Why not just pour all your data into a Thread::Queue and have a pool of workers servicing this queue? If you have a very large amount of data it can also be handy to have a size limited queue, BrowserUK gives a great example here: Re^5: dynamic number of threads based on CPU utilization.


    Pereant, qui ante nos nostra dixerunt!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1064566]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-10-04 04:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found