aspell-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to Share Read only Data between processes.


From: David Everett
Subject: Re: Best way to Share Read only Data between processes.
Date: Mon, 17 Jan 2000 16:40:4

On 01/17/00, "Kevin Atkinson <address@hidden>" wrote:
>"Martin Norbäck" wrote:
>>
>>Mon Jan 17 2000, Kevin Atkinson ->
>>>Could some of the unix programers on the list give me some hints as the
>>>best way to share readonly memory between processes.  Specially I would
>>>like for multiple aspell processes to be able to share the main word
>>>list.  Is formatting the data file so that it can be directly read into
>>>memory without any processing and using mmap the best bet?  Or is there
>>>a better way?
>>
>>Formatting the data file so that it can be mmap:ed directly is the only
>>way I can think of.
> 
>OK, thanks.  Mmaping the date file directly in will also allow for
>faster loading and possibly less memory usage so I think that is what I
>am going to do.
> 
That's a good idea, and for the right reasons, but be careful how you do 
it.  Memory mapping tends to be very machine specific for such things as 
page sizes and address management.  Different version of Unix aren't always 
compatable with each other and it only gets worse when someone tries to 
port the code over to Linus, Beos, or even Windoze.

I'm not saying that you shouldn't do it (in fact quite the opposite) but 
rather I'm asking that you consider puting the dictionary memory allocation 
and loading code in a totally isolated routine with a well defined 
interface so that it can be entirely replaced if necessary without 
affecting the other code.

David Everett



reply via email to

[Prev in Thread] Current Thread [Next in Thread]