Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

I prefer to:

by Petruchio (Vicar)
on Jan 14, 2007 at 04:52 UTC ( #594605=poll: print w/ replies, xml ) Need Help??

vote on I prefer to:

fork
[bar] 205/62%
thread
[bar] 61/18%
spawn
[bar] 65/20%
331 total votes
Comment on I prefer to:
Re: I prefer to:
by tye (Cardinal) on Jan 14, 2007 at 05:30 UTC

    spawn

    *mutter* buggered Unix bigots

    - tye        

      Added. Never let it be said that I am unwilling to accomodate the handicapped! :-)
        In that case, you should add:

          delegate

        To accommodate the PHB. :-)

      Okay, I do use Linux and BSD, but I'm not exactly a card-carrying Unix bigot. Non-Unix OSes I've used include PC-DOS 3.3, MS-DOS 5.0, 6.0, 6.22, Win95 OSR2, Win98SE, WinXP, Mac System 6, 7, MacOS 8, 9, BeOS 5PE, and OpenVMS 6, 7.2.

      Yet, I've never heard of spawn in this context before. And I can't seem to find it listed on Wikipedia, either. What type of system is it associated with, and what are the semantic differences between spawn versus fork or threads?

      Also I was under the impression that threading did not originate in the Unix universe but elsewhere were forking was more expensive, and was adopted by the Unix community only later. Was I mistaken?


      Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. You can just call me "Mister Sanity". Why, I've got so much sanity it's driving me crazy.

        You mention VMS. Surely you've heard of lib$spawn(), not to mention the DCL command spawn, which is the natural way of creating a subprocess to do something different from the parent (as distinct from launching a detached process, which is roughly the equivalent of a nohup). The posix layer implements fork, but this is not the native VMS way of doing or thinking about things.

        Digital had a lot to do with the invention of threads. PThreads are a derivative of DecThreads, and VMS was one of the platforms on which they were originally targetted. The reason for this was that there is a substantial overhead in process creation - spawns were expensive, and threads provided a convenient way of multitasking inside a process's address space.

        --

        Oh Lord, won’t you burn me a Knoppix CD ?
        My friends all rate Windows, I must disagree.
        Your powers of persuasion will set them all free,
        So oh Lord, won’t you burn me a Knoppix CD ?
        (Missquoting Janis Joplin)

        Yet, I've never heard of spawn in this context before. And I can't seem to find it listed on Wikipedia, either. What type of system is it associated with, and what are the semantic differences between spawn versus fork or threads?
        It sounds familiar to me, because of the node They didn't give me a fork so I have to eat with a spawn..

        "To spawn" is to produce offspring, hence, creating a child process. No mystery there. You can do it by calling system, for example.

          *mutter* buggered Unix bigots

      I just tried to find it in an archive somewhere and failed by that remark reminds me of a Dilbert cartoon from years ago that showed a Unix Guru type telling his protagonist "Here kid, here's a nickle, go buy yourself a real computer." One of my all time favorites and I can't find it.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        Hi blue_cowdawg,

        Here you go.

        I always liked that one, too.


        s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re: I prefer to:
by OfficeLinebacker (Chaplain) on Jan 14, 2007 at 05:31 UTC
    Dang, I need to learn how to do both. Haven't needed to do either yet. (that I know of, anyway ;)

    I like computer programming because it's like Legos for the mind.
Re: I prefer to:
by zerogeek (Monk) on Jan 14, 2007 at 06:30 UTC
    Oh... wait!
    You said FORK....
    This relates to Perl after all!
Re: I prefer to:
by BrowserUk (Pope) on Jan 14, 2007 at 08:45 UTC
      come on, take off your 'if all you have is a hammer every problem looks like a nail' hat. the question is not "i always" it's "i prefer". that's like saying i prefer whatever kind of ice cream is in the freezer when you actually have a favorite.
        that's like saying i prefer whatever kind of ice cream is in the freezer when you actually have a favorite.

        If I've just eaten something heavy, say pasta with cream cheese sauce, then I'll opt for something light, say lemon sorbet.

        On the other hand, if I've just eaten something light, sushi and salad, then I'd go for something with a bit more body. Butterscotch and Pecan ripple sounds good.

        So, my favorite does not depend just upon what is available, but also on the circumstances.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: I prefer to:
by shonorio (Hermit) on Jan 14, 2007 at 11:40 UTC
    I've a dream of one day we'll programming with threads simple as like we do with single threads, specially with the evolution of multiples processors. When Perl will have better tools to help-us with threads and we'll be able to use all the threads power.

    I have a dream ....

    Solli Moreira Honorio
    Sao Paulo - Brazil

Re: I prefer to -- What we really need
by starX (Chaplain) on Jan 14, 2007 at 17:54 UTC
    Is a new way of creating processes called spork().I don't really care what it does or why it's different from fork, as long as it is some trivial feature that is enough for the spork() zealots to get behind it, look everyone else in the eye, and say "Oh yeah, well I'm using spork()."

      Then consider your wish fulfilled: Spork.

      A word spoken in Mind will reach its own level, in the objective world, by its own weight
        I hang my head and kick some dirt around with my toe, muttering something about it being just a joke that I really didn't put much thought into. :)
Re: I prefer to:
by kwaping (Priest) on Jan 14, 2007 at 17:57 UTC
    Is this a double entendre poll? I can't tell for sure.

    ---
    It's all fine and dandy until someone has to look at the code.

      Well, if it wasn't, it wouldn't be a real Perlmonks poll!

      • another intruder with the mooring in the heart of the Perl

Re: I prefer to:
by stonecolddevin (Vicar) on Jan 14, 2007 at 21:44 UTC

    spooning leads to forking!

    meh.
Re: I prefer to:
by jesuashok (Curate) on Jan 15, 2007 at 02:09 UTC
    fork followed by exec
      I thought forking was followed by sleep()?
      -- gam3
      A picture is worth a thousand words, but takes 200K.
        do you mean sleep() -> fork() ? but, I meant fork() -> exec()
Re: I prefer to:
by swampyankee (Parson) on Jan 15, 2007 at 04:39 UTC

    What? No linda? No MPI?

    (yes, I know they're not the same thing; MPI and Linda are true parallel programming paradigms).

    emc

    At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

    —Igor Sikorsky, reported in AOPA Pilot magazine February 2003.
Re: I prefer to:
by arkturuz (Curate) on Jan 15, 2007 at 13:34 UTC
    Godfrey: Yes, Hell: where Satan belches fire, and enormous devils break wind
             both night and day! Hell: where the mind is never free from the
    	 torments of remorse, and your bottom never free from the pricking
    	 of little forks!
     
    Duke: Nooo! Spare me the little forks!
    
    Quoted from here.
      Knew that one without even looking :-)
Re: I prefer to:
by xiaoyafeng (Chaplain) on Jan 16, 2007 at 06:13 UTC
    fork. And what is spawn?

    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
Re: I prefer to:
by margulies (Friar) on Jan 16, 2007 at 11:31 UTC
    F**k, of course....

    Oh no, wait... You said Fork....

    Yeah, can be it too.
Re: I prefer to:
by tbone1 (Monsignor) on Jan 16, 2007 at 16:13 UTC
    I chose fork, but really I prefer to spoon.

    In June.

    'neath the moon.

    At noon.

    Or soon.

    With a loon.

    Or raccoon.

    On a dune.

    While the Goons.

    Sing a tune.

    (But not on a Zune.)

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

Re: I prefer to:
by poqui (Deacon) on Jan 16, 2007 at 21:14 UTC
    Thread; but on machines where that is not sufficiently supported I will fork. I don't believe that I have ever spawned.
      I don't believe that I have ever spawned.

      Nah... That's just for those upstream folks.

Re: I prefer to:
by Andrew_Levenson (Hermit) on Jan 18, 2007 at 11:42 UTC
    Dance with reckless abandon.
    C(qw/74 97 104 112/);sub C{while(@_){$c**=$C;print (map{chr($C!=$c?shift:pop)}$_),$C+=@_%2!=1?1:0}}
Re: I prefer to:
by tweetiepooh (Friar) on Jan 18, 2007 at 12:08 UTC
    Sometimes I just use exec without the fork.

    For example, one bit of code, running under cron, needs some environment settings made and rather than using a wrapper shell script I check the settings in the script and if not present make them then exec the script over itself.

    Probably not the best or even a good way to do it but it does work.

Re: I prefer to:
by blue_cowdawg (Prior) on Jan 18, 2007 at 18:42 UTC

    Once you get the threads out of the way, forking may result in spawning... <evil grin>


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: I prefer to:
by arc_of_descent (Hermit) on Jan 18, 2007 at 21:32 UTC

    By spawn, I hope that implies a system() call? Then yes, If my solution requires no IPC, then I would use system()

    What about POE?


    --
    Rohan

      Yes definitly ! I would POE.
Re: I prefer to:
by ambrus (Abbot) on Jan 27, 2007 at 12:45 UTC

    I prefer lightweight user-level threads, like ruby threads. They are ideal for both simple coroutines and hiding the select calls.

Re: I prefer to:
by neniro (Priest) on Jan 27, 2007 at 23:06 UTC
    respawn - like buddhists
Re: I prefer to:
by vili (Monk) on Jan 29, 2007 at 20:58 UTC
    "We're forked." -- Corey Ostman
Re: I prefer to:
by johndageek (Hermit) on Jan 29, 2007 at 21:06 UTC
    oooohhhh, you said FORK, suppose I shouldn't have voted with my glasses off. :(

    Enjoy!
    Dageek

Re: I prefer to:
by OfficeLinebacker (Chaplain) on Jan 30, 2007 at 00:00 UTC
    Hi, is there a resource that discusses these phenomena for a monk who maybe is not so savvy in the ways of "forking," &c?

    I like computer programming because it's like Legos for the mind.

View List Of Past Polls


Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-08-30 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls