u_queue: add a futex-based implementation of fences
Fences are now 4 bytes instead of 96 bytes (on my 64-bit system). Signaling a fence is a single atomic operation in the fast case plus a syscall in the slow case. Testing if a fence is signaled is the same as before (a simple comparison), but waiting on a fence is now no more expensive than just testing it in the fast (already signaled) case. v2: - style fixes - use p_atomic_xxx macros with the right barriers Acked-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -89,6 +89,7 @@ remove_from_atexit_list(struct util_queue *queue)
|
||||
* util_queue_fence
|
||||
*/
|
||||
|
||||
#ifdef UTIL_QUEUE_FENCE_STANDARD
|
||||
void
|
||||
util_queue_fence_signal(struct util_queue_fence *fence)
|
||||
{
|
||||
@@ -136,6 +137,7 @@ util_queue_fence_destroy(struct util_queue_fence *fence)
|
||||
cnd_destroy(&fence->cond);
|
||||
mtx_destroy(&fence->mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* util_queue implementation
|
||||
|
||||
Reference in New Issue
Block a user