Starting multiple processes

hello
i have to do the following
1. exec("E:\\TradingTools\\IBController\
\IBControllerStart_customised.bat")
2. application = WIN32OLE.new("Broker.Application")

I want to start 1 and then continue doing 2. however when i run it
realtime, the statement 2 waits for statement 1 to be completed which
takes long time. how do i initiate 1 and then withotu waiting goto
statement 2.

apreciate ur help

seede

Junkone wrote:

hello
i have to do the following
1. exec("E:\\TradingTools\\IBController\
\IBControllerStart_customised.bat")
2. application = WIN32OLE.new("Broker.Application")

I want to start 1 and then continue doing 2. however when i run it
realtime, the statement 2 waits for statement 1 to be completed which
takes long time. how do i initiate 1 and then withotu waiting goto
statement 2.

Wrap #1 in a thread:

Thread.new do
   exec(...)
end

···

--
        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Wouldn't help. This is #exec and not #system - the process does not
wait, it is completely replaced and "application =
WIN32OLE.new("Broker.Application")" is never executed.

You rather want fork.

fork do
  exec ...
end

Cheers

robert

···

2007/12/20, Joel VanderWerf <vjoel@path.berkeley.edu>:

Junkone wrote:
> hello
> i have to do the following
> 1. exec("E:\\TradingTools\\IBController\
> \IBControllerStart_customised.bat")
> 2. application = WIN32OLE.new("Broker.Application")
>
> I want to start 1 and then continue doing 2. however when i run it
> realtime, the statement 2 waits for statement 1 to be completed which
> takes long time. how do i initiate 1 and then withotu waiting goto
> statement 2.

Wrap #1 in a thread:

Thread.new do
   exec(...)
end

--
use.inject do |as, often| as.you_can - without end

Fork isn't implemented on Windows. Try this:

system("start E:\\TradingTools\\IBController\\IBControllerStart_customised.bat")
application = WIN32OLE.new("Broker.Application")

-Gordon

···

On Dec 20, 2007 2:34 AM, Robert Klemme <shortcutter@googlemail.com> wrote:

2007/12/20, Joel VanderWerf <vjoel@path.berkeley.edu>:
> Junkone wrote:
> > hello
> > i have to do the following
> > 1. exec("E:\\TradingTools\\IBController\
> > \IBControllerStart_customised.bat")
> > 2. application = WIN32OLE.new("Broker.Application")
> >
> > I want to start 1 and then continue doing 2. however when i run it
> > realtime, the statement 2 waits for statement 1 to be completed which
> > takes long time. how do i initiate 1 and then withotu waiting goto
> > statement 2.
>
> Wrap #1 in a thread:
>
> Thread.new do
> exec(...)
> end

Wouldn't help. This is #exec and not #system - the process does not
wait, it is completely replaced and "application =
WIN32OLE.new("Broker.Application")" is never executed.

You rather want fork.

fork do
  exec ...
end

Cheers

robert

--
use.inject do |as, often| as.you_can - without end

Robert Klemme wrote:

Junkone wrote:

hello
i have to do the following
1. exec("E:\\TradingTools\\IBController\
\IBControllerStart_customised.bat")
2. application = WIN32OLE.new("Broker.Application")

I want to start 1 and then continue doing 2. however when i run it
realtime, the statement 2 waits for statement 1 to be completed which
takes long time. how do i initiate 1 and then withotu waiting goto
statement 2.

Wrap #1 in a thread:

Thread.new do
   exec(...)
end

Wouldn't help. This is #exec and not #system - the process does not
wait, it is completely replaced and "application =
WIN32OLE.new("Broker.Application")" is never executed.

Oops, you're quite right, I was thinking of #system.

Maybe #system would be right for the OP:

   Thread.new do
     system("...")
   end

   application = ..

This is AFAIK platform independent, since it doesn't (explicitly, anyway) use #fork or "start".

···

2007/12/20, Joel VanderWerf <vjoel@path.berkeley.edu>:

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Maynot help you much but in Perl world I used IPC::Run module to do
exactly this. Not sure if there is a similar module in RubyLand.

Gordon Thiesfeld wrote:

> > > Junkone wrote:
> > > >  hello
> > > > i have to do the following
> > > > 1. exec("E:\\TradingTools\\IBController\
> > > > \IBControllerStart_customised.bat")
> > > > 2. application = WIN32OLE.new("Broker.Application")
> > > > I want to start 1 and then continue doing 2. however when i run it
> > > > realtime, the statement 2 waits for statement 1 to be completed which
> > > > takes long time. how do i initiate 1 and then withotu waiting goto
> > > > statement 2.
> > > 
> > > Wrap #1 in a thread:
> > > Thread.new do
> > > exec(...)
> > > end
> > 
> > Wouldn't help. This is #exec and not #system - the process does not
> > wait, it is completely replaced and "application =
> > WIN32OLE.new("Broker.Application")" is never executed.
> > You rather want fork.
> > fork do
> > exec ...
> > end
> > Cheers
> > robert
> > --
> > use.inject do |as, often| as.you_can - without end
> 
> Fork isn't implemented on Windows. Try this:
> system("start E:\\TradingTools\\IBController\\IBControllerStart_customised.bat")
> application = WIN32OLE.new("Broker.Application")
> -Gordon
···

On Dec 20, 2007 2:34 AM, Robert Klemme shortcutter@googlemail.com wrote:

2007/12/20, Joel VanderWerf vjoel@path.berkeley.edu:

> > Junkone wrote:
> > > hello
> > > i have to do the following
> > > 1. exec("E:\\TradingTools\\IBController\
> > > \IBControllerStart_customised.bat")
> > > 2. application = WIN32OLE.new("Broker.Application")
> > >
> > > I want to start 1 and then continue doing 2. however when i run it
> > > realtime, the statement 2 waits for statement 1 to be completed which
> > > takes long time. how do i initiate 1 and then withotu waiting goto
> > > statement 2.
> >
> > Wrap #1 in a thread:
> >
> > Thread.new do
> > exec(...)
> > end
>
> Wouldn't help. This is #exec and not #system - the process does not
> wait, it is completely replaced and "application =
> WIN32OLE.new("Broker.Application")" is never executed.
>
> You rather want fork.
>
> fork do
> exec ...
> end
>
> Cheers
>
> robert
>
> --
> use.inject do |as, often| as.you_can - without end
>

Fork isn't implemented on Windows.

Unless you are using cygwin. Sorry, I keep forgetting that the other
Windows based versions do not have it. Thanks for correcting me!

Try this:

system("start E:\\TradingTools\\IBController\\IBControllerStart_customised.bat")
application = WIN32OLE.new("Broker.Application")

Kind regards

robert

···

2007/12/20, Gordon Thiesfeld <gthiesfeld@gmail.com>:

On Dec 20, 2007 2:34 AM, Robert Klemme <shortcutter@googlemail.com> wrote:
> 2007/12/20, Joel VanderWerf <vjoel@path.berkeley.edu>:

--
use.inject do |as, often| as.you_can - without end

i tried that. it does not work for me. it waits
   Thread.new do
                   system("start E:\\TradingTools\\IBController\
\IBControllerStart_customised.bat")
    end
to get completed before going and doing this
application = WIN32OLE.new("Broker.Application")

···

On Dec 21, 2:55 pm, Joel VanderWerf <vj...@path.berkeley.edu> wrote:

Robert Klemme wrote:
> 2007/12/20, Joel VanderWerf <vj...@path.berkeley.edu>:
>> Junkone wrote:
>>> hello
>>> i have to do the following
>>> 1. exec("E:\\TradingTools\\IBController\
>>> \IBControllerStart_customised.bat")
>>> 2. application = WIN32OLE.new("Broker.Application")

>>> I want to start 1 and then continue doing 2. however when i run it
>>> realtime, the statement 2 waits for statement 1 to be completed which
>>> takes long time. how do i initiate 1 and then withotu waiting goto
>>> statement 2.
>> Wrap #1 in a thread:

>> Thread.new do
>> exec(...)
>> end

> Wouldn't help. This is #exec and not #system - the process does not
> wait, it is completely replaced and "application =
> WIN32OLE.new("Broker.Application")" is never executed.

Oops, you're quite right, I was thinking of #system.

Maybe #system would be right for the OP:

Thread.new do
system("...")
end

application = ..

This is AFAIK platform independent, since it doesn't (explicitly,
anyway) use #fork or "start".

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407- Hide quoted text -

- Show quoted text -