xinyou yan <yxy.716 <at> gmail.com> writes:
If I want to sleep until a event happened ? How can i do it in user mode. ...
Well, it depends what event and under what circumstances.
The are single-threading and multi-threading programs.
An event can be triggered by a counter, timer, signal, inotify, mutex lock/ unlock, barrier, polling, etc.
Some of these logical constructs are generic, others are composites of existing ones.
Often you put these logical constructs in a loop, perhaps with your own added timing or break-out logic.
$ apropos timer $ apropos signal $ apropos pthread $ propos notify $ apropos event $ apropos sleep $ apropos poll
JB