e_comp_wl: boost main thread when trylock failed in input-thread 46/302846/2
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 5 Dec 2023 07:03:14 +0000 (16:03 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Sun, 17 Dec 2023 23:42:21 +0000 (23:42 +0000)
commitde4c701552693e66e4947f010cc3c523ebebe7f8
treeb6676c02507fcc990efc54d64e3c008f3984f8d4
parent63b011c9561c74237837d6d3be99da787954ec5b
e_comp_wl: boost main thread when trylock failed in input-thread

  This patch solves the problem of performance degradation of
 the input-thread due to CPU contention in the main thread.

 AS-IS :
  - If the main thread locks the flush_mutex and becomes runnable status
   due to CPU contention, the input-threads will not be able to successfully
   lock the flush_mutex that the main thread has already locked.
  - The main thread has normal priority so it can stay runnable status
   for quite some time.
  - As long as the main thread remains runnable status, the input-thread
   cannot immediately flush events.

 TO-BE :
  - The input-thread checks for success or failure using g_mutex_trylock
   instead of g_mutex_lock for flush_mutex.
  - There is no difference in behavior when trylock succeeds as before.
  - When trylock fails, the input-thread boosts the main thread so that
   flush_mutex can be unlocked.
  - After the main thread unlocks and the input-thread successfully locks,
   input-thread clears boosting of the main thread immediately.

Change-Id: Iaf814e343afafad34715be1a3fe4f4d09cc02b1a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
configure.ac
packaging/enlightenment.spec
src/bin/e_comp_wl.c