[gegl] buffer: use g_usleep instad of g_thread_yield on tile contention
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: use g_usleep instad of g_thread_yield on tile contention
- Date: Sat, 23 May 2020 19:06:35 +0000 (UTC)
commit fd9e903daab667d12c1bca39eb93eea25781d261
Author: Øyvind Kolås <pippin gimp org>
Date: Sat May 23 20:01:55 2020 +0200
buffer: use g_usleep instad of g_thread_yield on tile contention
See issue gimp#4955 to work well in the hyper-threading case we actually
want to sleep for some time instead of keeping the scheduler busy.
We sleep for 1/1000th of a second which is the resolution g_usleep
has on win32.
gegl/buffer/gegl-tile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gegl/buffer/gegl-tile.c b/gegl/buffer/gegl-tile.c
index cdc6e4134..51f6f4f7e 100644
--- a/gegl/buffer/gegl-tile.c
+++ b/gegl/buffer/gegl-tile.c
@@ -325,7 +325,7 @@ gegl_tile_lock (GeglTile *tile)
++count;
if (count > 32)
- g_thread_yield ();
+ g_usleep (1000); /* the smallest sleepable time on win32 */
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]