Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
No such thing as a small change.
 
PerlMonks

Can I expect to have ithreads available?

by BrentDax (Hermit)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on Oct 31, 2009 at 19:18 UTC ( #804304=perlquestion: print w/ replies, xml ) Need Help??
BrentDax has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a Perl script that's part of a wider system which might be deployed to arbitrary "consumer" Unixes (Mac OS, Linux, maybe BSD, etc.). Can I generally expect the Perls on these sorts of platforms to support modern threading, or should I stick to more pedestrian things like fork()?

=cut
--Brent Royal-Gordon

Comment on Can I expect to have ithreads available?
Re: Can I expect to have ithreads available?
by Corion (Cardinal) on Oct 31, 2009 at 19:34 UTC

    I think most system perls are nowadays compiled with ithreads enabled. There is the forks module that emulates threads with fork() and Storable I believe. I'm not sure what you want to use threads for, so I cannot comment on the feasibility of using fork() instead.

[reply]

      This is as part of the client for a file-syncing application, somewhat like Dropbox. (It's a university project.) It basically has three broad responsibilities—monitoring the filesystem, watching the server for remote changes, and uploading and downloading files. I'd like to split these into three communicating threads or processes.

      Using threads would allow me to pass full objects around through something like Thread::Queue, instead of having to serialize the data somehow onto a socket or pipe, so if that's a viable solution it strikes me as likely being better.

      =cut
      --Brent Royal-Gordon

[reply]

        My reading of the tea leaves says you're planning on rolling this app out onto a bunch of oddball departmental servers which are probably not under your direct control. If your school is anything like the university I worked at, that means some of those machines are crust old boxen that should just be shot and put out of their misery, but geology has to have that exact version of perl 4 to support their favorite app. Sigh.

        So, what happens if the threaded code doesn't work on every single machine? Is the project a failure or will your PHBs be happy with 95% coverage? Can you go install a private version of perl on the machine in question? Is that ancient server lurking in some obscure corner of the campus going to come back to haunt you?

        That said, sure, reasonably up to date versions of perl will typically be compiled with ithreads on the major platforms. Really, it's up to you to make the call, but those are the points I would consider.

[reply]
Re: Can I expect to have ithreads available?
by tbone1 (Monsignor) on Nov 02, 2009 at 15:36 UTC
    I would suspect so. I haven't done this on EVERY available Unix variant or BSD/Linux release, but I've not encounted a problem yet. Also, keep in mind that OS X's Darwin is based on FreeBSD, so there are two birds with one stone.

    But it always pays to test, test, test. Some of us here have the scars to prove it.

    --
    tbone1, YAPS (Yet Another Perl Schlub)
    And remember, if he succeeds, so what.
    - Chick McGee

[reply]
Re: Can I expect to have ithreads available?
by fullermd (Friar) on Nov 03, 2009 at 02:31 UTC

    The ports for perl (5.8 and 5.10) on FreeBSD build with threading disabled by default.

[reply]

Back to Seekers of Perl Wisdom


Login:
Password
remember me
What's my password?
Create A New User

Node Status
node history
Node Type: perlquestion [id://804304]
Approved by Corion
Front-paged by Burak
help
Community Ads
Chatterbox
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users
Others chanting in the Monastery: (9)
CountZero
Moriarty
jmcnamara
atcroft
herveus
Eyck
NodeReaper
Gangabass
gnosti
As of 2009-11-21 11:06 GMT
Sections
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth

Future historians will find that the material characteristic of the current era is...

Aluminium
Plastic
Oil
Water
Carbon dioxide
Copper
Iron
Silicon
Salt
Uranium
Hydrogen
Other

Results (730 votes), past polls