Click here to Skip to main content
15,891,316 members
Home / Discussions / Java
   

Java

 
AnswerRe: bytecode_programming Pin
David Skelly19-Jan-11 22:29
David Skelly19-Jan-11 22:29 
AnswerRe: bytecode_programming Pin
_Erik_20-Jan-11 3:48
_Erik_20-Jan-11 3:48 
AnswerRe: bytecode_programming Pin
Nagy Vilmos20-Jan-11 4:56
professionalNagy Vilmos20-Jan-11 4:56 
Questionthread does not return from Runtime.exec Pin
WernerP19-Jan-11 1:55
WernerP19-Jan-11 1:55 
AnswerRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 12:31
professionalPeter_in_278019-Jan-11 12:31 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 12:52
WernerP19-Jan-11 12:52 
GeneralRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 13:07
professionalPeter_in_278019-Jan-11 13:07 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 23:27
WernerP19-Jan-11 23:27 
Hi,

I tried the same with process builder
ProcessBuilder pbuilder = new ProcessBuilder(cmdlist);

process = pbuilder.start();
procmon = new ProcessMonitor(process);


where
cmdlist[0] = "D:/MyPath/NmMutex"
cmdlist[1] = "lock" (btw. this doesn't mean the main thread waits at lock, its try_lock)

The thread returns as soon as the process, which was called ended. I tested it with a loop whithin the external process. If it is finite, the thread returns. If it is infinite the thread doesn't return. I.e. exec and start are blocking.

The idea to call ProcessBuilder.start within a separate process is basically good, but I woudn't receive a process handle when start would not return. And without that, I would not be able to attach streams to the stdout and stderr. Hence the process might block as soon as the stdout and stderr buffers are filled up.

If I started a background shell and within that my process, the solution would be os dependend (not KISS, complicated, not that good).

Thanks
Werner
GeneralRe: thread does not return from Runtime.exec Pin
WernerP20-Jan-11 6:32
WernerP20-Jan-11 6:32 
QuestionAbout Calculate.... Pin
Khalil Adam19-Jan-11 0:45
Khalil Adam19-Jan-11 0:45 
AnswerRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 1:35
Cedric Moonen19-Jan-11 1:35 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 2:31
Khalil Adam19-Jan-11 2:31 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 2:59
Cedric Moonen19-Jan-11 2:59 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:10
Khalil Adam19-Jan-11 3:10 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Richard MacCutchan19-Jan-11 3:14
mveRichard MacCutchan19-Jan-11 3:14 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:26
Khalil Adam19-Jan-11 3:26 
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:29
Cedric Moonen19-Jan-11 3:29 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:45
Khalil Adam19-Jan-11 3:45 
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:58
Cedric Moonen19-Jan-11 3:58 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 4:14
Khalil Adam19-Jan-11 4:14 
GeneralRe: About Calculate.... Pin
Richard MacCutchan19-Jan-11 5:19
mveRichard MacCutchan19-Jan-11 5:19 
GeneralRe: About Calculate.... Pin
TorstenH.19-Jan-11 22:20
TorstenH.19-Jan-11 22:20 
Generalthanks Cedric, Pin
Khalil Adam20-Jan-11 1:57
Khalil Adam20-Jan-11 1:57 
GeneralAbout Calculate.... Pin
Khalil Adam20-Jan-11 3:06
Khalil Adam20-Jan-11 3:06 
Questionwhat does this errors means? Pin
pancakeleh18-Jan-11 19:54
pancakeleh18-Jan-11 19:54 

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.