Solved

dbenv->open: Invalid argument , can not build Berkeley DB in RedHat Linux with --enable-posixmutexes

Posted on 2003-11-16
4
2,966 Views
Last Modified: 2010-04-29
Hi ,
I built Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 (Tampa)
Kernel 2.4.9-e.12smp on an i686 .I installed gcc-3.2.3 , glibc-2.3.2 on this machine.
I use autoconfig as follow:
../dist/configure --prefix=/export/home/build/cal-5.1.0
                     --enable-shared
                     --disable-profiled
                     --cache-file=../../../config.cache
                     --enable-shared
                     --disable-static
                     --enable-cxx
                     --enable-posixmutexes

When I run my program , I got this messsge:
dbenv->open: Invalid argument

If i don't use autoconfig with --enable-posixmutexes option , my program can run ok , but there are 4 child process running with my program 's process .
I want to know if I can build Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 with pthread library support or not .
Thank you very much.
.
0
Comment
Question by:honguyenbinh
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
g0rath earned 50 total points
ID: 9771384
--enable-posixmutexes
To force Berkeley DB to use the POSIX pthread mutex interfaces for underlying mutex support, enter --enable-posixmutexes as an argument to configure. This is rarely necessary: POSIX mutexes will be selected automatically on systems where they are the preferred implementation.
The --enable-posixmutexes configuration argument is normally used in two ways: First, when there are multiple mutex implementations available and the POSIX mutex implementation is not the preferred one (for example, on Solaris where the LWP mutexes are used by default). Second, by default the Berkeley DB library will only select the POSIX mutex implementation if it supports mutexes shared between multiple processes, as described for the pthread_condattr_setpshared and pthread_mutexattr_setpshared interfaces. The --enable-posixmutexes configuration argument can be used to force the selection of POSIX mutexes in this case, which can improve application performance significantly when the alternative mutex implementation is a non-blocking one (for example test-and-set assembly instructions). However, configuring to use POSIX mutexes when the implementation does not have inter-process support will only allow the creation of private database environments, that is, environments where the DB_PRIVATE flag is specified to the DB_ENV->open method.

Specifying the --enable-posixmutexes configuration argument may require that Berkeley DB be linked with the -lpthread library.


========


Linux does not support the pthread_*attr_setpshared() function, and it appears that the rpms disable this option, and your are forcing this option....what happens that if you attempt to run this, it will return the error ENOSYS

Some rpms in their changelogs say they enable this and later disable this
0
 
LVL 5

Expert Comment

by:g0rath
ID: 9771444
If you want to see if there is a patch to allow this...you would have to see what the Redhat people do
You may want to download the latest source rpm from rpmfind, and then take a look at their patches.

http://www.rpmfind

rpm -ivh whatever.src.rpm

cd /usr/src/redhat

.../SOURCES - should have the patches
.../BUILD - will have the build directory
.../SPECS - will have the template that shows all the patches applied.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
This article describes some very basic things about SQL Server filegroups.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now