Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-11-16
4
Medium Priority
?
3,027 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
g0rath earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

730 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