Home > OS >  How does Java actually spawn a process by ProcessBuilder on Windows platform?
How does Java actually spawn a process by ProcessBuilder on Windows platform?

Time:09-07

How does Java actually spawn a process by ProcessBuilder on Windows platform ? By what mechanism, system call, etc is actually doing the job? Javadoc doesn't specify and from the behavior exhibited by spawning processes its not immediately obvious.

CodePudding user response:

ProcessBuilder#start calls ProcessImpl#start, which calls the ProcessImpl constructor, which calls ProcessImpl#create aka Java_java_lang_ProcessImpl_create, which calls processCreate, which calls the Win32 syscall CreateProcessW.

  • Related