Hello,

On 12/3/13 4:20 PM, Sotas Development wrote:
Hi,

I want to build a Kamailio version without the usage of futex. First of all I notice that the  variable "use_futex" within Makefile.defs is hardcoded to the value "yes". Why is that? I want to get rid of this and build Kamailio without futex support. In the same file there are GCC options  like -DUSE_PTHREAD_MUTEX, -DUSE_POSIX_SEM etc. So I disabled the line use_futex and and added -DUSE_PTHREAD_MUTEX as follows;

#use_futex= yes
C_DEFS+=-DUSE_PTHREAD_MUTEX


After building Kamailio with these options:
Although the output of "kamailio -I" indicates that FUTEX is not used (PTHREAD_MUTEX is used instead) it still uses futex sneaky as its locking mechanism. I can see this after catting the content of /proc/<pid>/wchan.

This is because Kamailio hangs on futex after running it a while (see our other issue in the topic "Kamailio stability/timing problem w.r.t. registrations?").

Question is; How can I build Kamailio with a locking mechanism other than FUTEX? And why does the solution with Makefile.defs not work?
Maybe the compile switches got mixed over the time, as no one wanted/played to compile with no futex.

You should look at the following files to see if you can spot when the compile switch is not activated:

lock_alloc.h    lock_ops.c      lock_ops.h      lock_ops_init.h locking.h

If you cannot spot a fix, then open an issue on the tracker and should be investigated in the near future.

Cheers,
Daniel
-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda