home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,566 of 33,346   
   Jens Schmidt to Francis Glassborow   
   Re: IO thread, block or destroy/recreate   
   25 Sep 12 22:04:48   
   
   From: Jens.Schmidt-HH@gmx.de   
      
   Francis Glassborow wrote:   
      
   > On 25/09/2012 15:28, James K. Lowden wrote:   
   >> A pretty slow processor these days executes a billion or so cycles   
   >> per second, and instructions take under 100 cycles.  A 100-cycle   
   >> instruction called 100 times a second would use less than 0.001% of   
   >> the processor's capacity.   
      
   JFTR, instructions often are several to a cycle. What uses around 100   
   cycles is main memory access.   
      
   > I am unclear about what point you are making. Polling was generally a   
   > 'bad' solution on slow hardware but on modern hardware running at the   
   > speeds you mention it does not seem such a bad thing when it often   
   > simplifies the programming and allows the programmer to focus on the   
   > work he wants to get done.   
   >   
   > The question about any solution is 'does it work sufficiently fast?'   
      
   It all depends on the *relative* speed, not the actual duration. If one   
   poll takes just a little time in the same thread in relation to some useful   
   work, polling is o.k. But if one thread does nothing else than polling,   
   it doesn't matter how fast that is. The processor will be completely   
   occupied. Both for uniprocessors, where other threads get less time, and   
   on multiprocessors, where lots of synchronisation has to happen, this is   
   bad.   
   --   
   Viele Grüße,   
     Jens Schmidt   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca