[Barrelfish-users] Timed wait on condition variable
Georgios Varisteas
yorgos at kth.se
Wed Dec 19 14:17:48 CET 2012
Hi Zaheer,
The simplest way I can think of, is to use a differed event for the timeout. Check out lib/barrelfish/deferred.c and the deferred_event_register() function. You can also use it as inspiration for implementing an extension to the current conditionals variable API. The same lib contains functionality for periodic events.
cheers,
Georgios
________________________________________
From: Chothia Zaheer [zchothia at student.ethz.ch]
Sent: Wednesday, December 19, 2012 13:53
To: barrelfish-users at lists.inf.ethz.ch
Subject: [Barrelfish-users] Timed wait on condition variable
Hello,
Crescando has a synchronized queue with the typical get/put operations, which wait on a condition variable if the queue is either empty or full.
These operations can optionally be passed a timeout. Barrelfish's concurrency primitives don't currently support timeouts, so I am writing to enquire how this may be ported.
Conceptually it isn't too difficult to implement thread_cond_timedwait: extend the wait queues with a timeout and use an alarm to unblock the thread. In practice though it seems this would involve quite some effort (single-shot timer mechanism, spinlocks with bounded wait). Any thoughts or ideas on a simpler approach?
Thanks and kind regards,
--Zaheer
_______________________________________________
Barrelfish-users mailing list
Barrelfish-users at lists.inf.ethz.ch
https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
More information about the Barrelfish-users
mailing list