From: Justin Collins Date: 2009-02-24T22:58:54+09:00 Subject: Re: exec (new process or new thread?) to continue aidy wrote: > Hi, > > I have fired off an exe with the kernal method exec > > loader_app = "#{Dir.getwd}/PublishUi.exe" > exec(loader_app) > > The exec method seems to hold up the process > > so > > exec(loader_app) > puts "we got here" > > Will not print "we got here" till I close the app. > > I am not sure whether I should use a new thread or a new process here, > or whether there is an alternative. > > Thanks > > Aid exec doesn't hold up the process, it replaces it completely[1]. Your second example will never print "we got here". Assuming you do not need to communicate with, wait on, or know anything about the process you are starting, you can use fork[2] and exec this way: fork { exec load_app } -Justin [1] http://ruby-doc.org/core/classes/Kernel.html#M005979 [2] http://ruby-doc.org/core/classes/Kernel.html#M005980