Les Newell wrote:
> What is the correct way to sleep in the main loop of a user mode
> component? I have code like the following:
>
> while(1)
> {
>       do something...
>       usleep(1000);
> }
>
> For some reason the usleep almost never returns. If I take the usleep
> out the component works fine, though it obviously hogs the CPU.
>    
Usleep should return.  Are you actually trying to delay 1 millisecond 
though?  That may not work so well in userspace.

I did note that usleep is apparently obsolete, and you should use 
nanosleep instead.  (this is in the usleep manpage here: 
<http://linux.die.net/man/3/usleep>

- Steve


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to