Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Convert String Pin
Maximilien25-Jan-11 13:44
Maximilien25-Jan-11 13:44 
Questionboost::named_mutex not released after process abort Pin
WernerP25-Jan-11 4:06
WernerP25-Jan-11 4:06 
AnswerRe: boost::named_mutex not released after process abort Pin
T210225-Jan-11 19:41
T210225-Jan-11 19:41 
GeneralRe: boost::named_mutex not released after process abort Pin
WernerP26-Jan-11 0:16
WernerP26-Jan-11 0:16 
GeneralRe: boost::named_mutex not released after process abort Pin
TheGreatAndPowerfulOz26-Jan-11 9:57
TheGreatAndPowerfulOz26-Jan-11 9:57 
GeneralRe: boost::named_mutex not released after process abort [modified] Pin
WernerP26-Jan-11 11:52
WernerP26-Jan-11 11:52 
AnswerRe: boost::named_mutex not released after process abort Pin
Chuck O'Toole26-Jan-11 18:20
Chuck O'Toole26-Jan-11 18:20 
GeneralRe: boost::named_mutex not released after process abort [modified] Pin
WernerP26-Jan-11 21:48
WernerP26-Jan-11 21:48 
Hi,

the application which I'm working on is based on
a client server architecture

|java gui| <- gsoap -> |c++ server|

where the server is a windows or unix program, which embeds the business logic.

I want to make a gui for users, who don't need to know about that
and simply start the gui as if it was the whole app.

Thus the gui is managing server instantiation -
gui started && server not running => gui starts server.
gui started && server running => gui uses server.
server has no more session within timeout => server exits gracefully.
So what I actually would need is a singleton server and this would mean
to query the OS for the existence of the server process.

Java has no method to
query process lists on a system independent level or to
check, whether there is a certain process running -
there's just rudimentary support for process control.

Java is gui standard here. So I made a little app (nmmutex) which is
supposed to control a named mutex for the server's main thread. This app
exits always and writes it's result (acquired, not acquired) to the
return code. The mutex is queried in a non-blocking manner (try_to_lock).
Java can run that process via Runtime.exec.

Using that mutex, the server itself may control, whether there is already
an instance running. It also can try_to_lock the mutex, and if it's not
available, may return. The server itself could also take the role of nmmutex,
i.e. to query the mutex.

The caveat of using the mutex is, as far as I understood, that boost
interprocess objects like mutex and shared memory due to portability have
'kernel or filesystem' persistence. On windows it's filesystem persistence.
So if the server crashes, it might not be restartable even after a reboot.
And the user can't tell why.

I tend to dislike the mutex idea meanwhile, although using it seemed logical
to me first: I wanted to restrict use of server's main block to a single thread.
I could try to get a soap session at gui startup and assume the server does not
run when it fails. Or maybe there's a library which hides querys to the os,
like process list, behind a portable interface.

Cheers
Werner

modified on Thursday, January 27, 2011 4:00 AM

GeneralRe: boost::named_mutex not released after process abort Pin
Chuck O'Toole26-Jan-11 23:42
Chuck O'Toole26-Jan-11 23:42 
QuestionNeed interface index for recvd UDP packets Pin
Dave_25-Jan-11 3:50
Dave_25-Jan-11 3:50 
AnswerRe: Need interface index for recvd UDP packets Pin
HimanshuJoshi25-Jan-11 5:43
HimanshuJoshi25-Jan-11 5:43 
QuestionSet AutoRun fail under win 7 [modified][solved] Pin
yu-jian25-Jan-11 2:57
yu-jian25-Jan-11 2:57 
AnswerRe: Set AutoRun fail under win 7 Pin
Code-o-mat25-Jan-11 3:17
Code-o-mat25-Jan-11 3:17 
AnswerRe: Set AutoRun fail under win 7 Pin
CPallini25-Jan-11 3:20
mveCPallini25-Jan-11 3:20 
AnswerRe: Set AutoRun fail under win 7 Pin
Hans Dietrich25-Jan-11 3:47
mentorHans Dietrich25-Jan-11 3:47 
AnswerRe: Set AutoRun fail under win 7 Pin
Richard MacCutchan25-Jan-11 4:47
mveRichard MacCutchan25-Jan-11 4:47 
GeneralRe: Set AutoRun fail under win 7 Pin
yu-jian25-Jan-11 6:28
yu-jian25-Jan-11 6:28 
AnswerRe: Set AutoRun fail under win 7 Pin
yu-jian25-Jan-11 6:13
yu-jian25-Jan-11 6:13 
Questionshadow copy, deep copy and bitwie copy by constructor Pin
aesthetic.crazy25-Jan-11 2:26
aesthetic.crazy25-Jan-11 2:26 
AnswerRe: shadow copy, deep copy and bitwie copy by constructor Pin
CPallini25-Jan-11 2:44
mveCPallini25-Jan-11 2:44 
AnswerRe: shadow copy, deep copy and bitwie copy by constructor Pin
T210225-Jan-11 2:59
T210225-Jan-11 2:59 
AnswerRe: shadow copy, deep copy and bitwie copy by constructor Pin
Nemanja Trifunovic25-Jan-11 5:03
Nemanja Trifunovic25-Jan-11 5:03 
AnswerRe: shadow copy, deep copy and bitwie copy by constructor Pin
Andrew Brock25-Jan-11 5:11
Andrew Brock25-Jan-11 5:11 
QuestionDialogBar in SDI in MDI applcatiion Pin
Anu_Bala24-Jan-11 22:37
Anu_Bala24-Jan-11 22:37 
QuestionHow can i delete History and Cookies Directory in Internet explorer? Pin
yogish29324-Jan-11 19:18
yogish29324-Jan-11 19:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.