Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 19,262 of 19,505    |
|    Anton Shepelev to All    |
|    Re: Alternative to WAITFOR DELAY    |
|    30 Nov 17 13:58:58    |
   
   From: anton.txt@g{oogle}mail.com   
      
   Erland Sommarskog to Anton Shepelev:   
      
   >>Is there a more granular way to ease a tight   
   >>polling loop in T-SQL than WAITFOR DEALAY? A de-   
   >>lay of 3.33 milliseconds being a tad too long for   
   >>my purposes, I seek a way to implement delays of   
   >>about half a millisecond or shorter. I do not   
   >>need the precision of real-time systems and will   
   >>accept any solution to prevent a fast WHILE 1=1   
   >>loop from hogging the CPU.   
   >   
   >I guess that you could write a CLR procedure for   
   >the task.   
      
   Thanks. No idea why it didn't occur to me. I have   
   written .NET assemblies for MSSQL before. If per-   
   formace testing shows a need for a shorter delay I   
   will definitely follow your advice.   
      
   Meanwhile, my loop switches to zero delay once it   
   finds work to do, and back to a 3.3 ms delay once   
   all work is done and in incoming queue is empty.   
      
   --   
   () ascii ribbon campaign - against html e-mail   
   /\ http://preview.tinyurl.com/qcy6mjc [archived]   
      
   --- 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