473,569 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reentrant (?) Console Application....

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

Nov 17 '05 #1
28 2045
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

Nov 17 '05 #2
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

Nov 17 '05 #3
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.

Nov 17 '05 #4
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.

Nov 17 '05 #5

"C_Bone" <ca******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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.

Nov 17 '05 #6

"C_Bone" <ca******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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.

Nov 17 '05 #7
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

Nov 17 '05 #8
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

Nov 17 '05 #9

"C_Bone" <ca******@gmail .com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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.
Nov 17 '05 #10

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

Similar topics

2
3745
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 call to validateFields, all is fine. What could possibly cause this error? What is a non-reentrant method?
0
729
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 Language C#
6
11036
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 ?
0
288
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 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...
2
2836
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 (POSIX 1003.1-2003 list) which are safe(reentrant) but thats not sufficient for my purpose. Thanks in advance.
9
8280
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 make few other functions reentrant on Linux platform? I have searched a lot on the web for it but without any success. Man page of signal(2) has...
1
2737
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 and exclusive lock for a single writer. After implemented, I realized that the writer may suffer starvation: readers can continuously get shared...
17
3243
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 allocate dynamic memory? In other words: is it safe to use malloc() or free() in a thread-safe function? Thank you, Francesco
12
3465
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 each of my functions to maintain copies. Any suggestions on the best way to write a reentrant version of my library? - bearing in mind that my...
0
7694
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
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...
0
6278
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...
0
3651
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...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
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
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.