sleep

Sleeping in a Thread (C / POSIX Threads)

I am developing a multithreaded application that makes use of POSIX Threads. I am using threads for doing a periodical job and for that purpose I am using usleep(3) to suspend thread execution. My question is how can I cancel usleep() timer from the main thread, I tried pthread_kill(thread, SIGALRM) but it has a global effect which resul...

Why is the sleep-time of Sleep(1) seems to be variable in Windows?

Last week I needed to test some different algorithmic functions and to make it easy to myself I added some artifical sleeps and simply measured the clock time. Something like this: start = clock(); for (int i=0;i<10000;++i) { ... Sleep(1); ... } end = clock(); Since the argument of Sleep is expressed in milliseconds I ...

CLLocation to work in sleep/screen lock mode (iOs < 4.0)

I need to get the user's location even if the phone goes to sleep/screen lock mode. I've tried enabling location services in background mode by adding key to the info.plist file, but this method requires iOS >= 4.0. Is there any alternate method to get the location manager working in screen lock mode ...

Mac OS with KVM Switch - few seconds delay fix ?

I'm running Mac OS X with KVM Switch and when I switch to Mac OS, I have to wait few seconds until the system wakes up. I used InsomniaX but it didn't fix this issue. Do you know any fix for this delay ? ...