Re: a bit of a problem:using select and blocking

  • From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sun, 22 Feb 2009 20:31:30 -0700

select can wait that long, but I'm not extremely worried about waiting 50 ms, 
my idea is that it will wait the time, or if there are new events it'll grab 
them and keep going.
  ----- Original Message ----- 
  From: Ken Perry 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Sunday, February 22, 2009 8:11 PM
  Subject: RE: a bit of a problem:using select and blocking


   

   

  Before I look in to this code any more are you sure your computer will wait 
50 ms?  Try doing a hard loop printing out the times.  The reason I ask is 
sometimes things like Cygwin will not wait as it should.  Note it also will 
only wait 50 ms if you don't' get some other event.  If you want to continue to 
wait you will have to put an if after the select and continue until it reaches 
the amount of time you're waiting for.  If you do this remember to decrement 
the time out value by the amount it took to get back to the select or you will 
be waiting another new 50 ms.  

   

  Again though if you check your computer and it can wait 50 ms let me know. I 
will then take a closer look.

   

  Ken

   

  From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler Littlefield
  Sent: Sunday, February 22, 2009 7:46 PM
  To: programmingblind@xxxxxxxxxxxxx
  Subject: a bit of a problem:using select and blocking

   

  Hello list,

  I've got a quick question.

  I've attached a copy of the code that I'm using, just so the full thing is 
there.

  I'm writing a mud skeleton, and was wonddering if anyone could spot the 
problem; I'm trying to get select to run and block for 50 ms, then keep going. 
I think it's set to 5 ms right now, which is fine too.

  It is not doing that though, which is causing a bit of trouble because my 
scheduler needs to run too.

  I probably will have other classes that run at a later date, but right now 
it's just the server and the scheduler class that get pulses.

  Any ideas would be great.

  Comments on the code are welcome, too.

  I've come a long way from wondering why anyone would want to ever use a 
makefile, but I'm by no means the best at what I'm attempting. :)

   

Other related posts: