Tony,

I have read the replies so far and I have a question for you.  Are you sure you need 
to have the virtual address returned by mbuff to be the same to all tasks?  If mbuff 
provides a pointer to the memory isn't that enough?  

If all tasks map to the same named shared memory all tasks can access the same storage 
space.  If that space is allocated as a structure or an array of structures etc all 
tasks can access that memory using common structure access.  If you  want all tasks to 
know where each other task is looking at the shared memory you could have locations in 
shared memory that contain the array index that each task is using.

It is for this reason that I ask you to think about the problem again and ask yourself 
do you really need to have all tasks have the same virtual address?

Since you are closer to the task at hand maybe you have your reasons.

I hope this helps, and I hope it didn't hurt.

Rich

> ----------
> From:         Tony Denault[SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Monday, April 23, 2001 7:29 PM
> To:   [EMAIL PROTECTED]
> Subject:      [rtl] How to do shared memory with pointers?
> 
> 
> I need ~2MB memory buffer to shared data between the rtl and linux
> process. I need the virtual address returned by mbuff to be the same to
> all task gaining access to my mbuff() memory. How can this be done?
> 
> I have an existing real-time application which uses it own memory
> allocation lib. It uses the 2MB chunk, allocates a structure of pointer,
> then allocates many data buffer(s). So my mbuff() memory fill with
> pointer. I need to have other task (RT and non-RT) be able to follow the
> pointers.
> 
> If mbuff() can't, is there another way?
> 
> Thanks,
> 
> Tony
> 
> /-------------------------------------------------------------------------\
> | Tony Denault                       | Email: [EMAIL PROTECTED] |
> | NASA IRTF, Institute for Astronomy |              Phone: (808) 933-0893 |
> | 640 North Aohoku Place             |                Fax: (808) 933-0737 |
> | Hilo, Hawaii 96720                 |                                    |
> \-------------------------------------------------------------------------/
> 
> 
> ----- End of forwarded message from [EMAIL PROTECTED] -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
> 
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to