Perl - Threading and GetOpts

For the discussion of Perl, Python, Ruby, and PHP and other interpreted languages.

Perl - Threading and GetOpts

Post by Goatboy on Tue May 10, 2011 8:11 am
([msg=57230]see Perl - Threading and GetOpts[/msg])

Not to suck lick blow my own horn, but I just submitted an article explaining how threading and getopts work. I tried to keep it simple yet informational, and my only hope is that it helps someone along with perl.

/me looks at Dwere134
Assume that everything I say is or could be a lie.
User avatar
Posts: 2852
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)

Re: Perl - Threading and GetOpts

Post by thetan on Tue May 10, 2011 8:55 pm
([msg=57264]see Re: Perl - Threading and GetOpts[/msg])

There really isn't a great way to do this by default. I suppose you could write some pretty barbaric sleep()-based timing system to manage all the tasks, but that is neither elegant nor efficient.

Asynchronous event driven programming works <3

Imagine writing a GUI application where you couldn't refresh an animated object AND click a button at the same time.

Most GUI API's (IE: QT, GTK) are event driven. However, yes you're right most of them sit on a very tiny thread pool (typically 2-3 threads that are constantly re-used and repurposed because thread allocation is expensive)

You can also view javascript as a GUI centric frontend language that itself is event driven and asynchronous. However, javascript famously only uses a single thread for it's event loop

Out of browser implementations of javascript (node.js) allow you to create desktop GUI api's in pure javascript using GTK ... counter.js.
"If art interprets our dreams, the computer executes them in the guise of programs!" - SICP


“If at first, the idea is not absurd, then there is no hope for it” - Albert Einstein
User avatar
Posts: 657
Joined: Thu Dec 17, 2009 6:58 pm
Location: Various Bay Area Cities, California
Blog: View Blog (0)

Return to Interpreted Languages

Who is online

Users browsing this forum: No registered users and 0 guests