create a new process at runtime
-
Hi I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after. Because the logger takes the data from GUI I need also not to overload the GUI thread. The data comes fast in the GUI, so I will implement a LoggerQueue. I have been thinking of creating a new process for the logging and send my information with some basic IPC. the question: Is it possible to create a real time process? I mean not by creating a separate project and a separate exe file. Is it possible to lunch some code in a separate process at run-time?
-
Hi I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after. Because the logger takes the data from GUI I need also not to overload the GUI thread. The data comes fast in the GUI, so I will implement a LoggerQueue. I have been thinking of creating a new process for the logging and send my information with some basic IPC. the question: Is it possible to create a real time process? I mean not by creating a separate project and a separate exe file. Is it possible to lunch some code in a separate process at run-time?
George Nistor wrote:
Is it possible to create a real time process?
Yes.... if you are using a real time OS.
George Nistor wrote:
I mean not by creating a separate project and a separate exe file.
I do not know of any other way to do it.
George Nistor wrote:
Is it possible to lunch some code in a separate process at run-time?
I am not sure what this means.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
Hi I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after. Because the logger takes the data from GUI I need also not to overload the GUI thread. The data comes fast in the GUI, so I will implement a LoggerQueue. I have been thinking of creating a new process for the logging and send my information with some basic IPC. the question: Is it possible to create a real time process? I mean not by creating a separate project and a separate exe file. Is it possible to lunch some code in a separate process at run-time?
George Nistor wrote:
Is it possible to create a real time process?
What do you consider to be a real-time proces? Windows isn't a realtime OS, so the simple answer would be "no".
George Nistor wrote:
Is it possible to lunch some code in a separate process at run-time?
Yes, using
Process.Start
.George Nistor wrote:
I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after.
Let's rephrase that to "log as much as possible". What you'd want to build is called a watchdog-application. What you'd want to log is called a minidump. There's an awesome introduction here[^]. Another alternative would be using
OutputDebugString
; that would come closer to the idea of "logging actions", and can be read remotely.Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
Hi I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after. Because the logger takes the data from GUI I need also not to overload the GUI thread. The data comes fast in the GUI, so I will implement a LoggerQueue. I have been thinking of creating a new process for the logging and send my information with some basic IPC. the question: Is it possible to create a real time process? I mean not by creating a separate project and a separate exe file. Is it possible to lunch some code in a separate process at run-time?
You could, but you'll be writing about 10 times more code than just writing a seperate .EXE project and launching it from your existing code. But, if you must, check out the System.CodeDom[^] namespace.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
You could, but you'll be writing about 10 times more code than just writing a seperate .EXE project and launching it from your existing code. But, if you must, check out the System.CodeDom[^] namespace.
A guide to posting questions on CodeProject[^]
Dave KreskowiakYou mean like starting the same process again. I have to see if it not alreadz running I will start it in "master" mode, if it is running in "slave" mode. slave mode is the logger. ps. what I wanted was just not to have a separate exe and still start it like a real PROCESS.
-
You mean like starting the same process again. I have to see if it not alreadz running I will start it in "master" mode, if it is running in "slave" mode. slave mode is the logger. ps. what I wanted was just not to have a separate exe and still start it like a real PROCESS.
Ah. No, Windows does not support creating a seperate process from an in-memory byte stream in a process. You could keep the .EXE image in your app's resources, but you'd have to write it to a .EXE file on disk before you could launch it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak