CompuServe Thread

#Benchmark Tasks

5 messages in this thread
#109934From: Jim VogelFeb 19, 1988 7:31 PM
I am wondering how to find the name of a task. Or more apropaitely, why when I use a progam like AmiMon to look at active tasks, mine always shows up as a backround cli, while Amimon, which was also run from cli shows up with its name. The reason I want this is that I have two program's , one that is sleeping, and the other that I want to wake up the sleeping task, and modify some of the data in one of the variables in the sleeping task. I can wake it up by making the tasks timerport public, and then doing a find port. But how do I modify a var in another taks. I thought of using a record, with a known constant as its first member, and then searching memory for that constant. but not only could that take time, but what if there was another place that randomly had that same constant. If I offset from the wrong one, and modified that location, it would probably Guru. Any suggestion's? Or am I again missing somthing easy? Thanks, Jim Vogel
#109945From: Nick Sullivan/TransactorFeb 19, 1988 8:48 PM
Jim, the normal way to do something like that is through the message passing mechanism. Set up a message port for your sleeping task and invent some kind code to be carried in the message that will tell the task what you want modified. After it's carried out the modification, it can reply to the message and go back to sleep. Nick
#109949From: Jim VogelFeb 19, 1988 9:09 PM
In other words, open up ExtIO, with a rec containing a Message and the parameters that I want to change, and then send the messagfe any time I want to change par. I'll give it a try, let you know. Thanks, much JimVogel
#109978From: Nick Sullivan/TransactorFeb 20, 1988 12:03 AM
Umm, open up ExtIO? I'm not quite sure what you mean by that, but it doesn't sound right. The task whose variables you want to change has to create a public message port that your other task can search for (with FindPort()), and then wait at that port (as well as the one(s) you're already waiting at) for a message that would tell it – according to a convention you devise – what has to be done. If you want some sample C code for inter-task communication, you might take a look at Transactor's "Talking Tasks" demo, which I believe is in DL10 (probably as TTASKS.ARC). Nick
#110091From: Jim VogelFeb 20, 1988 9:01 PM
Nick, Ok thanks, will download it and take a look. Jim Vogel