I have two methods. The first one remotely executes an executable and the second one stars talking with an executable. The executable is a web-service. The first step does not return the true (executed through shell) because it starts and waits for the second step. Is there a way to execute the first method and the second method in parallel?
相关问题
- How to get the return code of a shell script in lu
- What uses more memory in c++? An 2 ints or 2 funct
- Is shmid returned by shmget() unique across proces
- How to get the maximum of more than 2 numbers in V
- how to get running process information in java?
you can use ruby's threads to do that. You can check out the links so you can have an ideia of what you can do with threads.
http://www.tutorialspoint.com/ruby/ruby_multithreading.htm
http://ruby-doc.org/core-2.0/Thread.html
Besides the stock threads support I'd like to mention the great Ruby gem Parallel
It can spawn processes in parallel and utilize multiple CPUs/cores at the same time.
Use thread.