Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. create a new process at runtime

create a new process at runtime

Scheduled Pinned Locked Moved C#
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    George Nistor
    wrote on last edited by
    #1

    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?

    L D 3 Replies Last reply
    0
    • G George Nistor

      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?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • G George Nistor

        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?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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[^]

        1 Reply Last reply
        0
        • G George Nistor

          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?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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

          G 1 Reply Last reply
          0
          • D 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 Kreskowiak

            G Offline
            G Offline
            George Nistor
            wrote on last edited by
            #5

            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.

            D 1 Reply Last reply
            0
            • G George Nistor

              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.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups