There's something I've been wondering. Is there some protocol in place for accessing global variables of another task in OS4 PPC code? Looking at examples code just accesses variables regardless.
In the 68K days we had things like geta4() type functions. Or just taking care of it yourself with a bit of ASM. But what about OS4?
I tend to be pedantic about these things and if I need pass data or modify it I tend to keep it inside an object that I send to another task. For example, in an interrupt, I would make use of the user data field to pass an object.
I am trying to write a simple multitasking communication function. Not quite there.
My program starts. SetUpProcesses() to start new process. I can't talk to it. I never get past IExec->WaitPort(). (The process is started.)
I just want to PutMsg() a simple message with a int32 value to tell it what to do, 1 through 99. -1 to quit. Or even send a text message, "start", "stop", "quit". A reply back that it's done would be nice, success or fail.
I based this off Thomas Rapp's multi3.c example. Tried to update it to OS4.
How can I have a program check to see if an instance of it is already running in OS4, using C? I want to prevent the possibility of multiple instances running at the same time.