On Sat, Apr 13, 2013 at 2:53 PM, Mihai Popescu <mih...@gmail.com> wrote: > Can someone give me some hints in this direction, please, what exactly > triggers usleep() internaly ?
usleep() doesn't trigger anything, but usleep(1) doesn't mean "sleep exactly 1us", it means "sleep at least 1us". In practice, your process is probably sleeping for much longer than that because of the scheduler clock's granularity. Try calling clock_gettime() immediately before and after the usleep() to see how long you're actually sleeping.