Closed Bug 417450 Opened 16 years ago Closed 15 years ago

Investigate implementation of memory mapping on OS/2

Categories

(NSPR :: NSPR, enhancement)

x86
OS/2
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mozilla, Assigned: wtc)

Details

Seeing the discussion in bug 412796 I wonder if we should finally implement the memory mapping stuff on OS/2.

There are some ideas at http://www.edm2.com/0610/memorymap.html on how that could be done (the author grants free use without limitations). The only problem is that the article doesn't have the code of the library attached to it any more...

Other implementations to guide this would be at http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/nsprpub/pr/src/md/unix/unix.c&rev=3.53&mark=3498-3599#3501 and http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/nsprpub/pr/src/md/windows/ntmisc.c&rev=3.23&mark=580-680#582
Ah, found the link for the library in an old newsgroup posting (MID  0Wpe3JvzLE6N-pn2-rV1MxvQ5yIzb@sweethome to group ) and there the correct link is given: <http://www.edm2.com/zips/edm0610s.zip> contains the two source files and the test program from the article.
OK, copied the library into os2misc.c for first testing and it at least compiles with GCC. The demo program in the source package also compiles and seems to work fine.

Now I have to see what the NSPR functions are actually supposed to do and if that can be done using the MMF API as provided by that library. The docs for the functions are here:
http://www.mozilla.org/projects/nspr/reference/html/priofnc.html#19466
Christian Langanke reported to me, that the original version of the
MMF funcs was not tread-safe. He implemented that and also reformatted
the code. See the Workplace Shell Toolkit sources on netlabs.org (or
the NEPMD sources). They appear stable to me.

I describe here the procedure to get the files, because currently the
netlabs.org project pages miss the info about the pserver string:

   cvs -d:pserver:<user>@cvs.netlabs.org:/netlabs.cvs/wpstk login
   cvs -d:pserver:<user>@cvs.netlabs.org:/netlabs.cvs/wpstk co .
   (Use guest/readonly for <user>/<password>.)

The MMF funcs are to be found in .\source\lib\wtkmmf.c

See also the documentation in .\source\book\wtkmmf.inc or better the
INF file in <ftp://www.netlabs.org/pub/wpstk/wpstkref.zip> or in the
binary distribution <ftp://www.netlabs.org/pub/wpstk/wpstk160.zip>.

Andreas
Thanks for the hint, Andreas!

Unfortunately, that code is licensed LGPL and so cannot be directly used in NSPR/Mozilla (and linking against another library that is not guaranteed to be on a user's system is something I really don't want to do). But if I have time again to look at this, I will ask Christian if he can accommodate the license to be useful for us.
I'm not sure it has what would be needed for Mozilla but on Yuri Dario's site:
http://web.os2power.com/yuri/MemoryMappedFiles
We won't get real memory mapping (this is because the available implementations apparently have problems with threading or are just not suitable for NSPR/Mozilla), but a simple, read-only read-file-into-memory-workaround is being implemented in bug 510705. 

So this one is WONTFIX.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.