Kotlin, Kotlin Coroutines, Android, Concurrency, Multithreading.
means only four processes will be able to access particular resources concurrently. Here P1, P2, P3, P4, P5, P6 trying to acquire the permit from the Semaphore. As per the FIFO, P1, P2, P3, P4 acquire the permits and Semaphore does not have permits available (i.e. 0). Thus P5 and P6 wait till the