Forum unknown
· Programming
#message passing
9 messages in this thread
I've been reading some of the amiga system liturature available in the book
stores and have a question about the message passing primatives. Does anyone
know if they are "safe" multiprocessing primitives. For example if you were to
set up a process as a shared data base handler, can the normal system routines
handle situations where to different processes (tasks) send a message at the
same time to the receiving process. I found the references to ports very
confusing, how does the system keep track of who sent a message so the reply
goes to the right task, are reply ports shared or does each sender have its own
reply port? Can anyone reply with a reasonably terse explantion of how message
passing and replying works?
SendMessage does the job of handling multiple tasks sending messages to a
single task. .. (or is it SendIO … whatever), messages are implimented in a
linked list que …. rather nice system. Each sender has his own reply
port….
That's "PutMsg". The reply port is basicly a convention of having the
message include a pointer to the port which the sender put there. "ReplyMsg"
basicly does a "PutMsg" using the reply port stored in the replied message.
I do maninly WaitIO/DoIO stuff, but I may have to get into Exec. to get the
spooler up and running.
I do maninly WaitIO/DoIO stuff, but I may have to get into Exec. to get the
spooler up and running.
That's "PutMsg". The reply port is basicly a convention of having the
message include a pointer to the port which the sender put there. "ReplyMsg"
basicly does a "PutMsg" using the reply port stored in the replied message.
SendMessage does the job of handling multiple tasks sending messages to a
single task. .. (or is it SendIO … whatever), messages are implimented in a
linked list que …. rather nice system. Each sender has his own reply
port….
Message ports are set up by conventions between the tasks using the ports.
Only one task can "wait" for a message port, but multiple tasks can read /
write to a port. If two tasks make a "simultaneous" GetMsg request, only one
will get a message ( assuming there was one message in the port ). Thus it
is safe to use a message as a token which only one task can own at a time.
You can set up many different ports, which can be made publicly accessible ;
any publicly accessible port can be found with the "FindPort" exec function.
Message ports are set up by conventions between the tasks using the ports.
Only one task can "wait" for a message port, but multiple tasks can read /
write to a port. If two tasks make a "simultaneous" GetMsg request, only one
will get a message ( assuming there was one message in the port ). Thus it
is safe to use a message as a token which only one task can own at a time.
You can set up many different ports, which can be made publicly accessible ;
any publicly accessible port can be found with the "FindPort" exec function.