Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^9: removing all threads..

by Tommy (Chaplain)
on Dec 12, 2012 at 04:44 UTC ( [id://1008441]=note: print w/replies, xml ) Need Help??


in reply to Re^8: removing all threads..
in thread removing all threads..

....And that is why it it should come as no surprise to anyone that you have 130911 XP at perlmonks, probably more once I hit the "submit" button; because you are awesome. Your code speaks for itself.

...And with no disrespect I have to say that the awesomeness of that code design is very similar in practice to the approach I used for my own assignment at $work, only I used the threads a little differently. There were two primary threads that shared a queue -- a downloader and a queue processor, and the downloader spawned five to ten threads to process downloads in parallel and return their downloaded payload as scalars to the primary downloader thread. The downloader then put together the datastructure that became the queue which was then consumed by the queue processor thread.

Everything worked fine on my RHEL 6 machines and my Debian servers. It even worked on the ubuntu workstation I was developing on at the time... But it puked on those proprietary custom-built RHEL 5 beasties. I was heartbroken, because it was clear that I had to abandon the code while it was so pure and elegant. It became much more cumbersome than one might think when I had to start bolting on Storable and working out my own locking mechanisms. Sure, I had the core files and I might have been able to dig deeper into the problem with those, but I didn't even want to start poking at them for fear that the approach was ultimately toxic. Maybe that was a mistake, but I had a looming deliverable and I couldn't take the risk of burning through development time trying to work out an already problematic methodology (at least in that environment). In the end, it was my name on the code when I handed it over, and naturally it had to function without flaw.

At the end of the day, upper management didn't give an END {} block how the code was written; they cared that it met client requirements, that it required very little RAM, that it ran bullet-proof for months at a time, and that everybody looked good for getting it done on time.

I always lamented what I saw as a lost opportunity, but took it as a lesson learned to -- at least for me -- beware of threads::shared on old perls.

Thank you for taking the time to put together that code sample

--
Tommy
$ perl -MMIME::Base64 -e 'print decode_base64 "YWNlQHRvbW15YnV0bGVyLm1lCg=="'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-19 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found