[Ace-users] Files created for USYNC_PROCESS mutexes

nglasser at cantata.com nglasser at cantata.com
Mon Sep 10 13:37:05 CDT 2007


Hello,

We are using a couple of named ACE_Mutex objects of type
USYNC_PROCESS.  We
run on Windows, Redhat Linux ES/AS 3.0+, and Solaris 9+. On Linux and
Solaris,
we see the following. The mutexes are statically initialized, but that
does
not seem to make any difference to the symptoms described below.

When a process using the mutexes is running, there are always files
with
names matching the names of the mutexes that appear in the current
directory
where the process was run. The fact that there are files is bad enough
on its own.

If the process is terminated abnormally, e.g. ^C, segmentation fault,
or
some other signal, then this files are left lying around. Also bad.

Depending on the state of the program and the mutexes at the time of
the abnormal termination, the existence of the files may prevent the
mutexes
from ever being acquirable again until the files are removed by hand.

We are using ACE 5.5.1, but this behavior has been around for a long,
long
time.

We use these mutexes to ensure that certain initialization code is run
only once, no matter how many processes may attempt to invoke it at
once.

Is this a bug or a feature? Is there a different synchronization
object
I can use between processes that will not behave in this fashion?

Here is a very short sample to illustrate the symptom:

--------------------

#include "ace/ACE.h"
#include "ace/Mutex.h"

main()
{
    ACE_Mutex foo_mutex(USYNC_PROCESS, "test_mut");

    printf("Hit return to continue\n");
    getchar();
}

--------------------

If you ^C the program, the test_mut file will remain.

                                Thanks,
                                Nathan



More information about the Ace-users mailing list