Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Splitting one large timeout into few smaller ones..

by Eyck (Priest)
on Apr 07, 2005 at 17:13 UTC ( [id://445792]=note: print w/replies, xml ) Need Help??


in reply to Re: Splitting one large timeout into few smaller ones..
in thread Splitting one large timeout into few smaller ones..

There are multiple jobs, they are supposed to run periodically (or in response to some events), every jobs consists of multiple tasks, so, when I abort the tasks, job gets cancelled, thus I can move on to another job (or even re-start the current one).

I don't know how I could move to another job without aborting the current one, that would require something coroutinish Coro.

  • Comment on Re^2: Splitting one large timeout into few smaller ones..

Replies are listed 'Best First'.
Re^3: Splitting one large timeout into few smaller ones..
by BrowserUk (Patriarch) on Apr 07, 2005 at 17:19 UTC

    Coro, fork, threads. Basically, any form of multitasking that allows your main process/thread (scheduler?) to initiate several concurrent jobs.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?
      Yeah, all of them bring serious problems to the table, Coro supposedly segfaults in multitude of situations.

      fork would be nice, but exchanging data between children, moving sockets between then (I have no idea if it's possible to pass SSL socket in any way...) etc is not a trivial task.

      And managing a pool of processes is a tedious task, I already asked perlmonks about that,but there were no interesting answers (besides the usual POE fanboy fanfare).

      Threads would be in randomly failing department, additionally there are way to many flavors, each with it's own set of problems, advantages and disadvantages.

      Anyhoo, I don't need concurrency, if anything, I might use some form of cooperative multitasking, but it may be that there's no such solution outthere

        A clearer description of the "tasks" in question, the communications requirements etc. would make it easier to make suggestions.

        Threads would be in randomly failing department, additionally there are way to many flavors, each with it's own set of problems, advantages and disadvantages.

        If we're talking Perl, there are only two flavours and only one of them is worth considering.

        It's not hard to arrange for threads to operate cooperatively--it's quite simple actually--but, in common with all forms of cooperative multitasking, you need to embed yeild points within the loops. If you are able to do this, then you could equally embed return unless $timeleft; at those same points and bottle out when the time has expired and move onto the next task.

        You seem to be hooked on telling us how Perl cannot help you, rather than helping us tell you how it could.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco.
        Rule 1 has a caveat! -- Who broke the cabal?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-16 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found