My appliction all of a sudden, stops working. and i executed following comand,
#ps -elf | grep aeroServ
and Got the following output,
#0 S binunun 5634 2300 0 80 0 - 7781 futex_ 15:41 pts/0 00:00:04
What i could able to sense is that, application is not running, but i do not understand which state the process is now. Could someone kindly explain.
The futex() system call provides a method for waiting until a certain condition becomes true. It is typically used as a blocking construct in the context of shared-memory synchronization. When using futexes, the majority of the synchronization operations are performed in user space.
Simply stated, a futex is a kernel construct that helps userspace code synchronize on shared events. Some userspace processes (or threads) can wait on an event (FUTEX_WAIT), while another userspace process can signal the event (FUTEX_WAKE) to notify waiters.
Modern day user-mode pthread mutex uses the futex kernel syscall [1] to implement the lock, which avoids the syscall in the non-contended case, so it can be very fast, acquiring the lock in the user-mode code entirely.
A Mutex is a lock that we set before using a shared resource and release after using it. When the lock is set, no other thread can access the locked region of code.
That's the WCHAN
column of the ps
output.
As the man page says:
nwchan
WCHAN
address of the kernel function where the process is sleeping (use wchan if you want the kernel function name). Running tasks will display a dash ('-') in this column.
So your process is blocked on a futex_*
call in kernel (these calls are related to mutex locking/unlocking and other synchronization primitives). Why it's blocked there, only you can tell by inspecting your code and/or using a debugger.
(See Futex for information on futexes.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With