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

thanks, that would be appriciated. I tried running through with gdb and 
printing the smaller things, I put in a counter:
static int var=1;
cout << var << endl;
var++
in pulse to make sure that it is doing what I thought and blocking.

  ----- Original Message ----- 
  From: Ken Perry 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Sunday, February 22, 2009 9:45 PM
  Subject: RE: a bit of a problem:using select and blocking


   

  If you don't fix it by tomorrow I will have a look when I get home from work. 
 It looks like your mostly doing it right I would print out your variables and 
make sure everything is right.  I know it looks right in how your setting them 
but maybe they are getting reset or something somewhere by a bad pointer.  

   

  I will look tomorrow with GDB but for now I have to get to bed got to get up 
at 5

   

  Ken

   

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

   

  it continues to block when it shouldn't be

   

    ----- Original Message ----- 

    From: Ken Perry 

    To: programmingblind@xxxxxxxxxxxxx 

    Sent: Sunday, February 22, 2009 8:57 PM

    Subject: RE: a bit of a problem:using select and blocking

     

     

    So are you saying it continues to block right now or is it returning to 
quickly?

     

    Ken

     

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

     

    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: