martin f krafft wrote: >also sprach Fabio Fabbri <[EMAIL PROTECTED]> [2005.08.23.1832 +0200]: > > >>>while [ ! -e/var/run/my_semaphore ]; do sleep 1; done >>> >>> >>I don't consider this a semaphore. A semaphore should avoid busy >>waiting. Using my implementation, busy waiting is avoided, and the >>script can go on immediately (when the task is scheduled), without the 1 >>second sleep. Exaggerating, using this kind of semaphores boot may >>become slower... >> >> > >What do you think the netcat process does underneath the hood? > > AFAIK, when a process uses the system call read(), the control goes to the kernel. I don't know how the kernel handles read(), but I hope it uses a better way than sleep(1)... maybe usleep(1) :-)
_______________________________________________ initscripts-ng-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/initscripts-ng-devel

