Even if Tony doesn't need to have "all tasks have the same virtual address"
, many of us could put this sort of feature to very good use.

The last RTL system I built (v0.9) used sets of massive tables in "shared"
(actually reserved high) memory. In these tables, there were so many
pointers to other tables that gross inefficiencies would have resulted by
the use of offsets rather than direct pointers (these tables were accessed
by the high-rate timer interrupt and by dozens of medium-rate tasks).  

Now granted, that system used only a P133 and the new one I'm building will
use something like a PIII-700 so that efficiency is somewhat less critical,
but -- naturally -- the new system is bigger too, thereby losing some of the
speed advantage I gain in the CPU.

Agreed that it's never absolutely essential to have commonality of
addressing, but in many instances it does make the code simpler to
understand and maintain -- and less error-prone too.  I haven't totally
given up on finding a "simple" way to get the same addressing, at least for
reserved memory, even if it means a kernel-hack since all of my systems are
one-off (actually three-off because there are two development stations but
since I'm the sole user on all of them, I can do "anything" I want to the
systems).



Norman Dresner
        Fellow Systems Engineer &(SGI) Advanced Signal Processing Laboratory
Administrator
        Radar Systems Engineering Department
        Electronic Systems and Sensors Segment
        Northrop Grumman Corporation
        MS 520
        Box 746
        Baltimore MD 21203

Voice:  (410) 993 - 2096        Mornings; all-day voice-mail
        (410) 969 - 8068        Afternoons with answering machine
FAX:    (410) 993 - 8084        On-site
        (410) 969 - 8068        Afternoons; call first to arrange
E-Mail: Mornings:       mailto:[EMAIL PROTECTED]
        Afternoons:     mailto:[EMAIL PROTECTED]

> -----Original Message-----
> From: Basham, Richard R [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 11:43 AM
> To:   '[EMAIL PROTECTED]'
> Subject:      RE: [rtl] How to do shared memory with pointers?
> 
> 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/
-- [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