Add-Ons & Services

Timeout values for NamedEvents

A general discussion forum.

Timeout values for NamedEvents

Postby codecandy2k » 29 Jan 2012, 01:54

So I was wondering if there was a reason that Poco::NamedEvent does not expose a timeout value? Blocking infinitely for an event is bad, but blocking infinitely for an event that may be dependent on another process is extra bad.
Posts: 40
Joined: 03 Dec 2011, 18:48

Re: Timeout values for NamedEvents

Postby guenter » 01 Feb 2012, 23:55

Mostly because the underlying OS APIs do not offer such a feature consistently, especially for platforms only supporting semop() (although Linux has semtimedop(), but this is not portable). Similarly, sem_timedwait() is also not available consistently (e.g. on Solaris it isn't available before Solaris 10). If we added this, we'd also need to add at least a feature check macro or function to check whether timed wait is available. Also timedwait should probably fall back to normal wait if timeouts are not supported by the OS.
Posts: 1120
Joined: 11 Jul 2006, 16:27
Location: Austria

Return to General Discussion

Who is online

Users browsing this forum: guenter and 1 guest