multithreading question

Discussion in 'ASP .Net' started by PJ6, Nov 29, 2009.

  1. PJ6

    PJ6 Guest

    I drive my game's physics engine using a simple loop running on its own
    thread. It invokes Thread.Sleep(1) when processing takes little or no time
    (under 4ms) to allow real time to catch up. For heavier loads the loop uses
    bigger timeslices, up to 20ms, with no sleeps.

    Since this is a multithreaded application, I decided to break out CHESS to
    test the object (render) buffer for problems. But CHESS hates
    Thread.Sleep() - it fails any test that hits one, calls it a livelock.

    I ended up switching out the original realtime loop with a high resolution
    multimedia timer, but I don't feel like it was a design improvement. I know
    sleeping threads should generally be avoided, but what about in games? Using
    a timer seems more... clumsy.

    Paul
    PJ6, Nov 29, 2009
    #1
    1. Advertising

  2. PJ6

    PJ6 Guest

    Re: multithreading question (SORRY WRONG NG)

    Sorry, meant to post this elsewhere.

    Paul

    "PJ6" <> wrote in message
    news:...
    >I drive my game's physics engine using a simple loop running on its own
    >thread. It invokes Thread.Sleep(1) when processing takes little or no time
    >(under 4ms) to allow real time to catch up. For heavier loads the loop uses
    >bigger timeslices, up to 20ms, with no sleeps.
    >
    > Since this is a multithreaded application, I decided to break out CHESS to
    > test the object (render) buffer for problems. But CHESS hates
    > Thread.Sleep() - it fails any test that hits one, calls it a livelock.
    >
    > I ended up switching out the original realtime loop with a high resolution
    > multimedia timer, but I don't feel like it was a design improvement. I
    > know sleeping threads should generally be avoided, but what about in
    > games? Using a timer seems more... clumsy.
    >
    > Paul
    >
    PJ6, Nov 29, 2009
    #2
    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. Rob

    multithreading question

    Rob, Sep 8, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    354
  2. Jean-Yves Nief

    question on multithreading, pipes

    Jean-Yves Nief, Dec 15, 2003, in forum: Python
    Replies:
    1
    Views:
    326
  3. Mark English

    Multithreading tkinter question

    Mark English, Dec 15, 2004, in forum: Python
    Replies:
    3
    Views:
    599
    Eric Brunel
    Dec 17, 2004
  4. facugaich

    Multithreading question

    facugaich, Oct 10, 2006, in forum: C Programming
    Replies:
    9
    Views:
    292
    facugaich
    Oct 10, 2006
  5. Alexander Dong Back Kim

    A simple question on multithreading

    Alexander Dong Back Kim, Mar 19, 2008, in forum: C++
    Replies:
    2
    Views:
    243
    Chris Thomasson
    Mar 19, 2008
Loading...

Share This Page