Re: Threads vs subprocesses

Discussion in 'Python' started by Dennis Lee Bieber, Jun 16, 2012.

  1. On Sat, 16 Jun 2012 20:01:12 +1000, John O'Hagan
    <> declaimed the following in
    gmane.comp.python.general:

    >
    > That looks like a possible way to do all the streams in a single thread,
    > although it works a little differently from your outline above if I understand
    > you correctly, in that only the events know their start times and they are
    > produced by iterators which can be modified on the fly and which can be added
    > and removed from the overall process at any time, so it's not possible to know
    > in advance which iterator will produce the chronologically next event. I think


    Which is why I mentioned processing all events at a time-point, then
    iterate for the next events if any are generated -- and a "time-ordered"
    (aka; priority) list, so the new events are positioned in the correct
    sequence against any other events that are in it.

    > that means that any ordered list of events would have to be re-ordered after
    > each event is read. It might be worth a try though. I notice there is simpy for


    Not "after each event is read" but when a new event is
    generated/inserted. The list is not a FIFO where new events are added to
    the end, but more of a priority queue where the lowest time is the next
    to be retrieved.

    > discrete event simulation in python. I'll look into it, thanks.
    >

    One major difference is that traditional discrete event simulation
    uses a false clock -- the simulation time advances to the next (first
    pending) event time immediately. You'd need to modify that operation to
    put in a real-time clock "sleep until" effect.
    --
    Wulfraed Dennis Lee Bieber AF6VN
    HTTP://wlfraed.home.netcom.com/
     
    Dennis Lee Bieber, Jun 16, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John O'Hagan

    Threads vs subprocesses

    John O'Hagan, Jun 15, 2012, in forum: Python
    Replies:
    0
    Views:
    242
    John O'Hagan
    Jun 15, 2012
  2. Dave Angel

    Re: Threads vs subprocesses

    Dave Angel, Jun 15, 2012, in forum: Python
    Replies:
    0
    Views:
    233
    Dave Angel
    Jun 15, 2012
  3. John O'Hagan

    Re: Threads vs subprocesses

    John O'Hagan, Jun 15, 2012, in forum: Python
    Replies:
    0
    Views:
    233
    John O'Hagan
    Jun 15, 2012
  4. Prasad, Ramit

    RE: Threads vs subprocesses

    Prasad, Ramit, Jun 15, 2012, in forum: Python
    Replies:
    0
    Views:
    237
    Prasad, Ramit
    Jun 15, 2012
  5. Dennis Lee Bieber

    Re: Threads vs subprocesses

    Dennis Lee Bieber, Jun 15, 2012, in forum: Python
    Replies:
    0
    Views:
    273
    Dennis Lee Bieber
    Jun 15, 2012
Loading...

Share This Page