Perbandingan Mekanisme Sinkronisasi Mutex dan Semaphore pada Sistem Operasi Android - Ghaniyah Latifa Putri; Rasya Mulki Putra; Harits Rahadi (Polygon : Jurnal Ilmu Komputer dan Ilmu Pengetahuan Alam, 2025)
The synchronization of mutex and semaphore mechanisms is an important technique in operating systems for managing concurrent resource access in multi-threaded environments. In the Android operating system, which relies on thread-based programming to maintain performance and responsiveness, these two mechanisms play a vital role in preventing race conditions and ensuring data integrity. A mutex is a locking object that ensures that only one thread can access a specific resource at a time, while a semaphore controls access to a limited number of resources by counting the number of threads that can access them simultaneously. In Android, these mechanisms are implemented using the Lock class for mutexes and the Semaphore class for semaphores, both of which can be used to control synchronization between threads in Android applications. This paper will discuss the application of these two mechanisms in the context of shared resource management, as well as a comparison of their performance and advantages in dealing with complex multi-threading scenarios on Android. Emphasis will also be placed on the challenges faced in using these two mechanisms in Android applications, as well as how proper programming can avoid deadlocks and improve application efficiency.