Forum Stats

  • 3,840,120 Users
  • 2,262,569 Discussions
  • 7,901,154 Comments

Discussions

unable to initialize mutex: Function not implemented

356611
356611 Member Posts: 5
edited Aug 2, 2006 9:24AM in Berkeley DB
Hello,

I've got the following error (I've specified --with-mutex=POSIX/pthreads/library on configure)

unable to initialize mutex: Function not implemented
/tmp/__db.001: unable to initialize environment lock: Function not implemented

while doing the following:

otsenv.open( db_dir.c_str() , DB_CREATE | DB_THREAD , 0);

Berkeley DB 4.4.20, configure with :
CC=gcc323 CXX=g++323 ~/work/src/db-4.4.20/dist/configure prefix=/users/home/lmarzullo/opt/db-4/4.4.20/ enable-cxx with-mutex=POSIX/pthreads/library enable-posixmutexes


Any idea please ?

Thanks a lot

Laurent Marzullo

Comments

  • 524300
    524300 Member Posts: 340
    Hi Laurent,
    unable to initialize mutex: Function not implemented
    /tmp/__db.001: unable to initialize environment lock:
    Function not implemented
    You've forced Berkeley DB to use POSIX mutexes on a platform where they are not fully implemented. This error is most common on older Linux systems, which had basic POSIX threads but didn't implement sharing of mutexes between processes.

    To get around this, you will need to either:

    * use a more recent Linux release;
    * rebuild Berkeley DB without forcing the use of POSIX mutexes (but the fallback test-and-set mutexes perform poorly when there is contention); or
    * only open private database environments (with the DB_PRIVATE flag, which prevents sharing between processes).

    Regards,
    Michael.
  • 525536
    525536 Member Posts: 4
    Thanks for the answer ...

    I Will try DB_PRIVATE.

    What should I check for upgrade ?

    I'm working on Redhat ES 3..

    Here information about all 'glibc' (where I think pthread is implemented)
    glibc-common-2.3.2-95.37
    glibc-devel-2.3.2-95.37
    glibc-2.3.2-95.37

    And here the pthread library installed by the package glibc

    /lib/i686/libpthread-0.10.so
    /lib/i686/libpthread.so.0
    /lib/libpthread-0.10.so
    /lib/libpthread.so.0
    /lib/tls/libpthread-0.60.so
    /lib/tls/libpthread.so.0


    Which version of glibc/pthread should I need in order to be able to use 'inter process' shared mutex ?

    Thanks all
  • 522681
    522681 Member Posts: 24
    Unfortunately we can't tell you which RedHat releases contain inter-process POSIX pthread mutex support and which do not. It's a combination of factors, but specifically, it's a combination of the GNU C library and the Linux Operating System release, and we haven't tracked RedHat releases closely enough to know which ones work and which ones don't.

    Regards,
    Keith Bostic
This discussion has been closed.