I need a way for my console application to stay running and be able to
be called at any time with some parameters, do it's work, then wait to
be called again, repeat.
Here's the details:
I have a C# engine that's used to run a lot of complex financial
calculations and return a report based upon the calculated results. My
program is called by another program... let's just call it "MasterApp"
and i'll call my program "Calc". Calc is the console app exe.
Here's the basic process:
1. User inputs some data into MasterApp.
2. User clicks tells MasterApp to "Go".
3. MasterApp writes out an xml file, then launches "Calc.exe"
4. Calc reads the xml to create the inputs that it understands
(there's some translation there).
5. Calc calls some of it's own dlls (C#), etc. with the translated
inputs.
6. The "guts" of calc.exe (the dlls which are called) take the inputs,
pull the data it needs, calculates and returns a report.
7. The report is written to a directory specified as a paramater to
the calc.exe call.
8. Calc closes.
9. MasterApp waits for Calc.exe to close, then displays the report to
the user.
The real issue here is performance. It's taking way too long to load
everything that's need into memory to run each time (JIT, etc.) and
then close everything back down EVERY time the user runs a report. I'd
like somehow, once the system is run the first time, for it to stay in
memory so that the user does not experience the load time lag every
single time they run a report.
As a note, loading the assemblies into the GAC doesn't appear to help.
I'll go ahead and apologize up front, because I am not certain that i'm
using the correct terminology to describe the issue i'm trying to
resolve.
Thanks in advance for any help/advice you can give.
- Carl 28 2036
I'm not sure I understand the choice of architecture here ...
Is there a NEED for calc.exe to be a command window application?
Can't you package your business logic (i.e.calc.exe) in a dll and call from
a web service, or package as a COM+ application, etc.
--
Of all words of tongue and pen, the saddest are: "It might have been"
Bill.Richards @ greyskin .co .uk http://greyskin.co.uk
"ca******@gmail.com" wrote: I need a way for my console application to stay running and be able to be called at any time with some parameters, do it's work, then wait to be called again, repeat.
Here's the details:
I have a C# engine that's used to run a lot of complex financial calculations and return a report based upon the calculated results. My program is called by another program... let's just call it "MasterApp" and i'll call my program "Calc". Calc is the console app exe.
Here's the basic process: 1. User inputs some data into MasterApp. 2. User clicks tells MasterApp to "Go". 3. MasterApp writes out an xml file, then launches "Calc.exe" 4. Calc reads the xml to create the inputs that it understands (there's some translation there). 5. Calc calls some of it's own dlls (C#), etc. with the translated inputs. 6. The "guts" of calc.exe (the dlls which are called) take the inputs, pull the data it needs, calculates and returns a report. 7. The report is written to a directory specified as a paramater to the calc.exe call. 8. Calc closes. 9. MasterApp waits for Calc.exe to close, then displays the report to the user.
The real issue here is performance. It's taking way too long to load everything that's need into memory to run each time (JIT, etc.) and then close everything back down EVERY time the user runs a report. I'd like somehow, once the system is run the first time, for it to stay in memory so that the user does not experience the load time lag every single time they run a report.
As a note, loading the assemblies into the GAC doesn't appear to help.
I'll go ahead and apologize up front, because I am not certain that i'm using the correct terminology to describe the issue i'm trying to resolve.
Thanks in advance for any help/advice you can give.
- Carl
I'm not sure I understand the choice of architecture here ...
Is there a NEED for calc.exe to be a command window application?
Can't you package your business logic (i.e.calc.exe) in a dll and call from
a web service, or package as a COM+ application, etc.
--
Of all words of tongue and pen, the saddest are: "It might have been"
Bill.Richards @ greyskin .co .uk http://greyskin.co.uk
"ca******@gmail.com" wrote: I need a way for my console application to stay running and be able to be called at any time with some parameters, do it's work, then wait to be called again, repeat.
Here's the details:
I have a C# engine that's used to run a lot of complex financial calculations and return a report based upon the calculated results. My program is called by another program... let's just call it "MasterApp" and i'll call my program "Calc". Calc is the console app exe.
Here's the basic process: 1. User inputs some data into MasterApp. 2. User clicks tells MasterApp to "Go". 3. MasterApp writes out an xml file, then launches "Calc.exe" 4. Calc reads the xml to create the inputs that it understands (there's some translation there). 5. Calc calls some of it's own dlls (C#), etc. with the translated inputs. 6. The "guts" of calc.exe (the dlls which are called) take the inputs, pull the data it needs, calculates and returns a report. 7. The report is written to a directory specified as a paramater to the calc.exe call. 8. Calc closes. 9. MasterApp waits for Calc.exe to close, then displays the report to the user.
The real issue here is performance. It's taking way too long to load everything that's need into memory to run each time (JIT, etc.) and then close everything back down EVERY time the user runs a report. I'd like somehow, once the system is run the first time, for it to stay in memory so that the user does not experience the load time lag every single time they run a report.
As a note, loading the assemblies into the GAC doesn't appear to help.
I'll go ahead and apologize up front, because I am not certain that i'm using the correct terminology to describe the issue i'm trying to resolve.
Thanks in advance for any help/advice you can give.
- Carl
Sorry, I should have clarified things a little better....
Calc.exe is really a wrapper around our existing core business and
calculations logic (which exists in a series of C# dll assemblies).
The whole thing is a stand alone desktop application, so a web service
wouldn't work. All of our code is C#, so i'm not sure how/if a COM+
app would work.
The MasterApp program will only communicate with an exe. MasterApp
writes its output to a directory, calls calc.exe with a couple of
command line parameters (location of its output, etc), then waits for
calc.exe to exit.
I hope i've answered your questions.
I great appreciate your response.
- Carl.
Sorry, I should have clarified things a little better....
Calc.exe is really a wrapper around our existing core business and
calculations logic (which exists in a series of C# dll assemblies).
The whole thing is a stand alone desktop application, so a web service
wouldn't work. All of our code is C#, so i'm not sure how/if a COM+
app would work.
The MasterApp program will only communicate with an exe. MasterApp
writes its output to a directory, calls calc.exe with a couple of
command line parameters (location of its output, etc), then waits for
calc.exe to exit.
I hope i've answered your questions.
I great appreciate your response.
- Carl.
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Sorry, I should have clarified things a little better....
Calc.exe is really a wrapper around our existing core business and calculations logic (which exists in a series of C# dll assemblies).
The whole thing is a stand alone desktop application, so a web service wouldn't work. All of our code is C#, so i'm not sure how/if a COM+ app would work.
The MasterApp program will only communicate with an exe. MasterApp writes its output to a directory, calls calc.exe with a couple of command line parameters (location of its output, etc), then waits for calc.exe to exit.
I hope i've answered your questions.
I great appreciate your response. - Carl.
I would suggest in-proc remoting, that is, let the master application create
a separate Application Domain (AD) that handles the core business (so
you'll have to load the assemblies in that domain). The master application
can pass the XML as an argument in a (asynchronous) remoting call that
starts the business process, let the 'report' be the return 'value' of the
call, or use a call-back when done.
Willy.
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Sorry, I should have clarified things a little better....
Calc.exe is really a wrapper around our existing core business and calculations logic (which exists in a series of C# dll assemblies).
The whole thing is a stand alone desktop application, so a web service wouldn't work. All of our code is C#, so i'm not sure how/if a COM+ app would work.
The MasterApp program will only communicate with an exe. MasterApp writes its output to a directory, calls calc.exe with a couple of command line parameters (location of its output, etc), then waits for calc.exe to exit.
I hope i've answered your questions.
I great appreciate your response. - Carl.
I would suggest in-proc remoting, that is, let the master application create
a separate Application Domain (AD) that handles the core business (so
you'll have to load the assemblies in that domain). The master application
can pass the XML as an argument in a (asynchronous) remoting call that
starts the business process, let the 'report' be the return 'value' of the
call, or use a call-back when done.
Willy.
Well, the problem with that is the MasterApp is a 3rd party application
over which I have no control. They will ONLY interact with my app in
the way in which I have described.
Thanks,
Carl
Well, the problem with that is the MasterApp is a 3rd party application
over which I have no control. They will ONLY interact with my app in
the way in which I have described.
Thanks,
Carl
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Well, the problem with that is the MasterApp is a 3rd party application over which I have no control. They will ONLY interact with my app in the way in which I have described.
Thanks, Carl
Well, I'm afraid you're stuck, the master application starts a new calc.exe
for each report, so your calc.exe has to start all over again, there is
nothing that can be left in memory once a process has terminated.
Willy.
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Well, the problem with that is the MasterApp is a 3rd party application over which I have no control. They will ONLY interact with my app in the way in which I have described.
Thanks, Carl
Well, I'm afraid you're stuck, the master application starts a new calc.exe
for each report, so your calc.exe has to start all over again, there is
nothing that can be left in memory once a process has terminated.
Willy.
Let's pretend for a second that I put *another* exe in between the two
apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe),
would it then be possible to do what i'm thinking and have Calc.exe
stay running as described above?
Let's pretend for a second that I put *another* exe in between the two
apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe),
would it then be possible to do what i'm thinking and have Calc.exe
stay running as described above?
C_Bone wrote: Well, the problem with that is the MasterApp is a 3rd party application over which I have no control. They will ONLY interact with my app in the way in which I have described.
Thanks, Carl
Is it possible to break your application into two pieces? One that the 3rd
party app calls, and one that actually runs the calculations? The one the
app calls would communicate to the other one via some protocol (TCP,
perhaps), and the other could stay running?
The only problem would be if the amount of data that's communicated between
the two is large.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
C_Bone wrote: Well, the problem with that is the MasterApp is a 3rd party application over which I have no control. They will ONLY interact with my app in the way in which I have described.
Thanks, Carl
Is it possible to break your application into two pieces? One that the 3rd
party app calls, and one that actually runs the calculations? The one the
app calls would communicate to the other one via some protocol (TCP,
perhaps), and the other could stay running?
The only problem would be if the amount of data that's communicated between
the two is large.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
Yes, it would be possible to do that.... the data sent between the two
wouldn't be very large.
So are you saying have them communicate via TCP when all of the
applications, etc. are on one machine?
Yes, it would be possible to do that.... the data sent between the two
wouldn't be very large.
So are you saying have them communicate via TCP when all of the
applications, etc. are on one machine?
No, I think you would make matters worse.
As Willy has already told you, you're stuck.
What you are doing is not recommended. It's not 'Process Delegation' or
'PolyProcessing' or anything with a cool name; it's simply process-trashing
and Windows was not built for that kinda treatment. Sorry...
Happy Coding
- Michael S
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Let's pretend for a second that I put *another* exe in between the two apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe), would it then be possible to do what i'm thinking and have Calc.exe stay running as described above?
No, I think you would make matters worse.
As Willy has already told you, you're stuck.
What you are doing is not recommended. It's not 'Process Delegation' or
'PolyProcessing' or anything with a cool name; it's simply process-trashing
and Windows was not built for that kinda treatment. Sorry...
Happy Coding
- Michael S
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Let's pretend for a second that I put *another* exe in between the two apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe), would it then be possible to do what i'm thinking and have Calc.exe stay running as described above?
"C_Bone" <ca******@gmail.com> wrote in message
news:11********************@g47g2000cwa.googlegrou ps.com... Yes, it would be possible to do that.... the data sent between the two wouldn't be very large.
So are you saying have them communicate via TCP when all of the applications, etc. are on one machine?
Have CalcWrapper.exe call a Windows Service?
Mythran
"C_Bone" <ca******@gmail.com> wrote in message
news:11********************@g47g2000cwa.googlegrou ps.com... Yes, it would be possible to do that.... the data sent between the two wouldn't be very large.
So are you saying have them communicate via TCP when all of the applications, etc. are on one machine?
Have CalcWrapper.exe call a Windows Service?
Mythran
C_Bone wrote: Yes, it would be possible to do that.... the data sent between the two wouldn't be very large.
So are you saying have them communicate via TCP when all of the applications, etc. are on one machine?
Sure.
Though, TCP may not be the best choice. I would recommend it if you had
some experience with it, but if you don't have any particular knowledge of
TCP, you could be better served going with something else.
Perhaps remoting because of it's object oriented nature? Perhaps shared
memory because it would be very fast?
TCP is a good fallback though, as it allows you a bit of flexibility if you
need it for the future.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
C_Bone wrote: Yes, it would be possible to do that.... the data sent between the two wouldn't be very large.
So are you saying have them communicate via TCP when all of the applications, etc. are on one machine?
Sure.
Though, TCP may not be the best choice. I would recommend it if you had
some experience with it, but if you don't have any particular knowledge of
TCP, you could be better served going with something else.
Perhaps remoting because of it's object oriented nature? Perhaps shared
memory because it would be very fast?
TCP is a good fallback though, as it allows you a bit of flexibility if you
need it for the future.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Let's pretend for a second that I put *another* exe in between the two apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe), would it then be possible to do what i'm thinking and have Calc.exe stay running as described above?
Like Michael said, it probably will make things worse. The reason you want
to keep your business process alive is to eliminate the "start-up cost",
that makes me think that the actual "service time" is small and you think
the start-up time takes a considerable amount of the total processing time.
If that's the case you won't see any gain because now you will waste your
time by starting a middleman and by passing the XML stream to yet another
process.
Willy.
"C_Bone" <ca******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Let's pretend for a second that I put *another* exe in between the two apps... call it "CalcWrapper.exe".
If MasterApp.exe calls CalcWrapper (which in turn calls calc.exe), would it then be possible to do what i'm thinking and have Calc.exe stay running as described above?
Like Michael said, it probably will make things worse. The reason you want
to keep your business process alive is to eliminate the "start-up cost",
that makes me think that the actual "service time" is small and you think
the start-up time takes a considerable amount of the total processing time.
If that's the case you won't see any gain because now you will waste your
time by starting a middleman and by passing the XML stream to yet another
process.
Willy.
Willy, you nailed it as far as performance.
The start-up time of the app is a large percentage of the total time.
The service time is actually pretty fast.
Willy, you nailed it as far as performance.
The start-up time of the app is a large percentage of the total time.
The service time is actually pretty fast.
Michael S wrote: No, I think you would make matters worse. As Willy has already told you, you're stuck.
What you are doing is not recommended. It's not 'Process Delegation' or 'PolyProcessing' or anything with a cool name; it's simply process-trashing and Windows was not built for that kinda treatment. Sorry...
I can't say that I agree with that. Although it is most unfortunate that
the Master program in his work expects things to operate in a Unix-like way
(start process, do work, terminate), adding a stable process "in the back
end" isn't going to cause the problem you suggest... he already has that
problem because of the way the Master program is working.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
Michael S wrote: No, I think you would make matters worse. As Willy has already told you, you're stuck.
What you are doing is not recommended. It's not 'Process Delegation' or 'PolyProcessing' or anything with a cool name; it's simply process-trashing and Windows was not built for that kinda treatment. Sorry...
I can't say that I agree with that. Although it is most unfortunate that
the Master program in his work expects things to operate in a Unix-like way
(start process, do work, terminate), adding a stable process "in the back
end" isn't going to cause the problem you suggest... he already has that
problem because of the way the Master program is working.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Adrian Parker |
last post by:
For some reason when I call validateFields before .Update (see below), I get
this error: "Consumer's even handler called a non-reentrant method in the
provider"
However if I comment out the...
|
by: Martin B |
last post by:
Hallo to everyone!
Problem:
--------
GridView Exception: reentrant call to the SetCurrentCellAddressCore function
System:
-------
WinXP Professional, english, .NET Framework 2.0 Beta...
|
by: junky_fellow |
last post by:
what are reentrant functions? What are the characteristics of a reentrant code ?
what things should be kept in mind while writing a reentrant code ?
|
by: carlbono |
last post by:
I need a way for my console application to stay running and be able to
be called at any time with some parameters, do it's work, then wait to
be called again, repeat.
Here's the details:
I...
|
by: TheOne |
last post by:
Would anyone please point me to a list of reentrant GNU C/C++ library
functions? I have searched a lot on the web for it but without any
success. Man page of signal(2) has listed system calls...
| |
by: TheOne |
last post by:
Would anyone please point me to a list of reentrant C library
functions? I want to know which C library functions are safe to
use inside a signal handler across all platforms. Does GNU C
library...
|
by: jj_online |
last post by:
This is not a C++ specific issue. However, I am trying to implement a
readwritelock in C++ and hence would like to get help from this
group.
a readwritelock allows shared lock among all readers...
|
by: fmassei |
last post by:
Dear all,
I'm trying to put some old code in a portable, cross-platform library
and I'm facing a big problem: is there a standard, platform-
independent way to write a reentrant function that...
|
by: Bit Byte |
last post by:
I am modifying some legacy code, to make the functions reentrant. I use
lots of global data (large nested structs) to pass data around quicky.
The global structures are far too large (in size) for...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |