On Tue, Jul 23, 2013 at 6:30 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 23/07/2013 04:53, liu ping fan ha scritto: >> The scenior I can figure out is if adopting timeout of poll, then when >> changing the deadline, we need to invoke poll, and set the new >> timeout, right? > > Yes, you need to call aio_notify so that poll is reinvoked. > I try to list the difference between alarm_timer and timeout of poll. It includes thread-affinity, resolution and easy-use.
Most of all, thread-affinity The main issue with alarm timer is the affinity of timer_t with threads. For linux, SIGEV_THREAD_ID has been supported for a very long time and we already associate the signal with the specified thread. So the only issue is left for other unix, we can emulate the affinity by using SIGEV_THREAD and repost the event to the specified thread. As to timeout of poll, it has the affinity of threads. Resolution: alarm_timer provides higher resolution, but do we care about it? easy-use: The reset of the deadline as mentioned. Finally, I admit timeout of poll will save large chunk of platform-related code. Thanks and regards, Pingfan > Paolo