A question on RProcess

Login to reply to this topic.
Thu, 2008-02-21 09:21
Joined: 2008-01-22
Forum posts: 8

Why there are 2 calls( RProcess::Create and RProcess::Resume) for starting a process while one call like fork(in unix) will do the same.

Also, what is the use of RProcess::Rendezvous

Thanks
booklog


Thu, 2008-02-21 16:07
Joined: 2004-11-29
Forum posts: 1233
Re: A question on RProcess

It means you have a lot finer control over the process then you have with the simplistic "fork".

Create just creates the process, then you might want to do other calls on it, for example Rendevouz, or Logon, before you call Resume, to let it actually start executing.
Or... you can make sure startup time overhead a lot less, by Create:ing it at a non-time-critical time, like startup, and then just call the very light weight "Resume" to have it start executing more or less immediately, when you need it to start.
You can also attach to already created processes with "Open", and in this case you would never call "Create", but still have a handle to the process.

Rendevouz is for synchronization with the process, you can through this call have an active object in your creating process that waits until code from within the process call RProcess::Rendevouz.
For example to signal some initialization is complete, if for example, the process will contain some IPC service, you might need the creating thread to wait for a while before trying to use the service.

  • Login to reply to this topic.