[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Sleep() ?

Uli Kunkel

11/12/2008 12:26:00 PM

I have to wait in a loop until some condition is true.
What I want is to have some function that doesn't take the resources
while waiting.

Thanks for any suggestions.
5 Answers

Maxim Yegorushkin

11/12/2008 12:33:00 PM

0

On Nov 12, 12:26 pm, Uli Kunkel <genija...@yahoo.com> wrote:
> I have to wait in a loop until some condition is true.
> What I want is to have some function that doesn't take the resources
> while waiting.

Take a look at wait_for_data_to_process() function in
http://www.boost.org/doc/libs/1_37_0/doc/html/thread/synchronization.html#thread.synchronization.c...

--
Max

Michael DOUBEZ

11/12/2008 12:45:00 PM

0

Uli Kunkel a écrit :
> I have to wait in a loop until some condition is true.
> What I want is to have some function that doesn't take the resources
> while waiting.
>
> Thanks for any suggestions.

There is no standard c++ way of doing. Depending on your OS and the
reactivity requiered you can wait for a signal (see conditions in POSIX
thread by example, sleep (in preemptive OS) or release the processor (in
cooperative OS).

--
Michael

DJ Dharme

11/13/2008 1:01:00 PM

0

On Nov 12, 5:26 pm, Uli Kunkel <genija...@yahoo.com> wrote:
> I have to wait in a loop until some condition is true.
> What I want is to have some function that doesn't take the resources
> while waiting.
>
> Thanks for any suggestions.

I thinks he is looking for something like "select" function.

DJ Dharme

11/13/2008 1:10:00 PM

0


> I thinks he is looking for something like "select" function.

Sorry typo, the correct form would be

I think he is looking for something like "select" function.

Try googling for "select function"

Uli Kunkel

11/14/2008 10:14:00 AM

0

Maxim Yegorushkin wrote:
> On Nov 12, 12:26 pm, Uli Kunkel <genija...@yahoo.com> wrote:
>> I have to wait in a loop until some condition is true.
>> What I want is to have some function that doesn't take the resources
>> while waiting.
>
> Take a look at wait_for_data_to_process() function in
> http://www.boost.org/doc/libs/1_37_0/doc/html/thread/synchronization.html#thread.synchronization.c...
>
> --
> Max

I think that external library (50MB) is maybe a overkill for just this
one task.
Is there some other solution?