in reply to Re^4: shared scalar freed early (queue)
in thread shared scalar freed early
Oh, so it is "slower" because you are doing all kinds of blocking between threads (not because it is more expensive). Don't do that.
If you need to preserve order, than create slots for the data and let the threads fill in the slots at their leisure. Way, way simpler code. I failed at trying to understand what the point of your overly complicated sample code was. Sorry.
Don't pass thread handles through queues. Pass work items. If you only have as many threads as you need, then you don't need the semaphore at all.
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: shared scalar freed early (block)
by chris212 (Scribe) on Feb 24, 2017 at 15:40 UTC | |
by tye (Sage) on Feb 24, 2017 at 19:10 UTC | |
by chris212 (Scribe) on Feb 24, 2017 at 19:33 UTC | |
by tye (Sage) on Feb 25, 2017 at 05:22 UTC | |
by chris212 (Scribe) on Feb 28, 2017 at 20:19 UTC | |
|
In Section
Seekers of Perl Wisdom