help me?????

I am a student and I am using QNXRTP for a class project. In this project
I need to time how long it takes to load a process and kill it. I have
been using spawnl() but when I add a kill() the process is never actually
loaded, it is killed as soon as it begins. I was wondering if anyone had
any ideas on how I could get this to work because I really don’t want to
try it on Windows. Thanks for your help in advance.

Ross Brantner
Shippensburg University, PA

Perhaps if you posted a few more details about what you did (code snippet?),
and the results you’re seeing, we could be of more help. From what it
sounds like to me just from your description, if you spawn a process, then
kill it, it’s extremely likely that the process would be killed before it
had a chance to actually accomplish anything. For example, if you had:

start = clock( );
pid = spawnl( yada, yadayada, …);
kill( pid );
end = clock( );
elapsed = end - start; // This doesn’t account for wraparound!

Depending on the system load, priorities of everything, and so on, I would
say you would execute the kill() call any time after the target process was
loaded into memory but not executing yet (it’s loaded & scheduled but not
running), to “a while” after the target process had been executing. As I
said, the exact outcome is going to depend on a lot of things. What exactly
were you expecting to happen?

-Warren


“Ross Brantner” <brantner@innernet.net> wrote in message
news:8u4vq2$us$1@inn.qnx.com

I am a student and I am using QNXRTP for a class project. In this project
I need to time how long it takes to load a process and kill it. I have
been using spawnl() but when I add a kill() the process is never actually
loaded, it is killed as soon as it begins. I was wondering if anyone had
any ideas on how I could get this to work because I really don’t want to
try it on Windows. Thanks for your help in advance.

Ross Brantner
Shippensburg University, PA

Thanks for your help, you were right on about the process being killed
before it did anything. I got tired of fighting with it so I wrote a dummy
process to load that terminates itself, so I could just use spawnl(
P_WAIT,…) and time the whole loading, processing, and unloading time.
Thanks for your help.