473,804 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple processes

hello all,
I have a c++ code in which is sth like

while(i < N)
{
....
do some processing in c++ to create file abc
system("simulat or_name < abc")
......c++ ... processing..... .
}
The problem is my simulator takes some time T to load and only then
starts working on the file abc.After completion the simulator is
exited and the same thing(loading + execution happens in next
iterations..) Since the number of iterations are huge (wasted time NT)
i want something like :

open the simulator only once( just doing system("simulat or_name") and
get the handle to the simulator prompt. From then on i just load the
new "abc" file in each iteration, wait for the simulation to complete
(do not exit the simulator) and start my new iteration.

I read about creating a new child process(popen command) etc but could
not figure out exactly how to get a handle to the prompt, and wait
till the simulation is completed. Also the child process is not to be
killed otherwise i lose the handle.
I would appreciate any help/references in this regard. There is
nothing simulator specific. You can imagine a simple gdb command in
place of simulator_comma nd and handle at gdb>

-Thanks
Vikas
Jul 19 '05 #1
1 3739
"Vikas Vijay" <vi****@ececs.u c.edu> wrote in message
news:ce******** *************** **@posting.goog le.com
hello all,
I have a c++ code in which is sth like

while(i < N)
{
...
do some processing in c++ to create file abc
system("simulat or_name < abc")
.....c++ ... processing..... .
}
The problem is my simulator takes some time T to load and only then
starts working on the file abc.After completion the simulator is
exited and the same thing(loading + execution happens in next
iterations..) Since the number of iterations are huge (wasted time NT)
i want something like :

open the simulator only once( just doing system("simulat or_name") and
get the handle to the simulator prompt. From then on i just load the
new "abc" file in each iteration, wait for the simulation to complete
(do not exit the simulator) and start my new iteration.

I read about creating a new child process(popen command) etc but could
not figure out exactly how to get a handle to the prompt, and wait
till the simulation is completed. Also the child process is not to be
killed otherwise i lose the handle.
I would appreciate any help/references in this regard. There is
nothing simulator specific. You can imagine a simple gdb command in
place of simulator_comma nd and handle at gdb>

-Thanks
Vikas

This is operating system specific (the boost threads library may allow you
to make this somewhat platform independent, but I doubt that it will do the
complete job). I suggest that you post to a newsgroup for your operating
system.

Alternatively, it might be simpler to integrate your while() loop into your
simulator (perhaps your simulator could retrieve data from a file giving
instructions for each run).
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7227
by: Primo | last post by:
Hello, I am building a data management application with the following processes: Process 1 is a Windows service which uses FileSystemWatcher to monitor a directory. Process 2 opens a file copied into the directory and inserts the data into a data warehouse. Process 3 queries the data warehouse and transfers the results to a data mart.
9
23088
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated to a pool. If I assign only one application to a applicaton pool and have multiple worker processes assigned to that pool. Will my application be processed by many worker processes?
5
2495
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for this execution... we need immediate execution of all notification processes and would prefer to spawn multiple instances generating emails at one time. Solution ? I took a look at threading, and at first it looked to be the answer.
2
2323
by: Brett | last post by:
What are the advantages/disadvantages of using one process with multiple threads or doing the same task with multiple processes, each having one thread? I see using multiple threads under one process as being a problem. Potentially, one thread may crash and could bring down the whole process, including all the other threads. Using one process per thread seems more independent. This is similar to what happens when you open multiple...
22
8942
by: Brett Romero | last post by:
If my UI app uses three DLLs and two of those DLLs reference something named utilities.dll, does the UI app load utilities.dll twice or does the compiler recognize what is going on and load utilities.dll just once? Thanks, Brett
4
1979
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to an example of multiple threads synchronized to use a single shared resource? -- Gregory Gadow
4
9175
by: colson | last post by:
I know how to create a new process using System.Diagnostics.Process and wait for the process to end using WaitForExit(). How do I wait for multiple processes? Is there an equivalent to WaitForMultipleObjects under .NET? Thanks
4
3778
by: Diffident | last post by:
Hello All, IIS 6.0 - I have an application which resides in its own application pool. Does anyone know if we can create multiple application pools for the same application? If we can create multiple application pools to serve a single application's request will it improve the performance? Thanks for your suggestions!!
2
2538
by: comp.lang.php | last post by:
I have an app that is going berzerk on its own; without any code or environmental changes of any kind, for some bizarre reason it will randomly just hang, spawn multiple Apache processes and completely ignore max_execution_time, literally running infinitely. Using PHP 5.2.0, Apache 1.3 and Win XP Is this normal "bizarre" behavior that can occur within this setup; if so, what workarounds have you found to combat this, other than the...
19
6344
by: Zytan | last post by:
I want multiple instances of the same .exe to run and share the same data. I know they all can access the same file at the same time, no problem, but I'd like to have this data in RAM, which they can all access. It seems like a needless waste of memory to make them all maintain their own copy of the same data in RAM at the same time. What's the best way to achieve this? I've heard of memory mapped files, so maybe that's the answer. ...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.