home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / wizards / 5372 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.2 KB  |  25 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!psgrain!neon!pail!servio!chrisp
  3. From: chrisp@slc.com (Chris Pinkham)
  4. Subject: choosing shared memory addresses
  5. Message-ID: <1993Jan5.004036.4263@slc.com>
  6. Organization: Servio Corp, Beaverton Oregon, US
  7. Date: Tue, 5 Jan 1993 00:40:36 GMT
  8. Lines: 15
  9.  
  10. Say I want to attach to a large shared memory segment, and I need it to be
  11. aligned across some arbitrary page boundary (i.e. the starting address needs
  12. to be a multiple of this arbitrary page size, where the page size will always
  13. be a multiple of the OS page size). How would I go about ensuring that the
  14. address I pick will work? I assume that arbitrarily picking an address would
  15. be a bad idea, and may fail depending on what other data is using that address
  16. space.
  17.  
  18. What problems would I bump into by rounding an OS nominated address up by
  19. (address % MY_PAGE_SIZE) bytes? Is there a chance that that would screw up
  20. something at the end of the shared memory segment (i.e. if the OS placed the
  21. segment of size s at a, and I want it to be at a+x, how do I know whether
  22. someone else already occupies the space at a+x+s)?
  23.  
  24. Are there any foolproof tricks out there? Am I being paranoid?
  25.