[comp.os.mach] passing of vm data.

dennisg@kgw2.bwi.WEC.COM (Dennis Glatting) (01/18/90)

i got a vm and mach message passing question.

i have two tasks, a serial protocol task and a higher level interface (hli).
when data is received the protocol task formats a mach message and sends
it to the hli.  it is out-of-line data stored in a vm page and the mach
message states msg_type_deallocate=FALSE.  once the data is sent i
have two tasks sharing the same vm page.  the protocol task hangs on to the
data in case any references to it occur.  the hli consumes the data.  the
question becomes how should it be deallocated?  i ASS-UMEd that both tasks
could do a vm_deallocate() of the page and it would no longer be 
referenced by each task.  i further assumed that when no references
exist to the page it is truely released by the kernel.  i've found, 
however, that if one task does a vm_deallocate() the other task will
crash if it does a vm_deallocate() on the same page.  is this the case?
the problem is i have two independent entities and don't wish to increase
processor overhead by saying "it is okay to delete the page now" from
the hli to the protocol task.  in conclusion this feable minded person 
asks "what fundamental mistake am i making"?


--
 dennisg@kgw2.bwi.WEC.COM  | Dennis P. Glatting
 ..!uunet!tron!kgw2!dennisg |
   <<This section isn't available on-line.>>