Find the answer to your Linux question:
Results 1 to 2 of 2
I'm wondering how python's thread & fork support is compared to perl? Which one is best option among Perl and Python...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85

    Thumbs up python vs perl for threads/forking


    I'm wondering how python's thread & fork support is compared to perl? Which one is best option among Perl and Python

  2. #2
    Linux User
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    260
    The "fork()" function is actually a system-call, so any programming languages which can execute the "fork()" function will all be calling the exact same system-level function in the end. Performance is determined by execution of byte-code in the runtime, not by "fork()".

    As for threads, most runtime environments that execute bytecode, like the runtime for Perl, Python, or Java, all have their own internal threading mechanisms which are fine-tuned to work with their garbage collectors, and tested to avoid deadlocks, race conditions, and other security problems. It's hard to say which is "better", they both need to provide the same functionality. As for performance, skillful programming is much more important than the internal threading implementation.

    With a cursory Google search you can find multithreading libraries for both Perl and Python which are recommended for use with their respective programming system. It is either not possible, or not recommended, to use bindings to an external library like pthreads.

    If it were me, however, and multiple threads and performance were an issue, I try to avoid using high-level languages like Perl or Python to get the job done.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •