Boost logo

Boost Users :

From: Oliver Mutz (mutz_at_[hidden])
Date: 2006-08-25 02:38:27


It's quite hard to guess what might be the reason for your stream errors
without seeing any code or call stacks at exception time.
I had some problems in the past with memory mapped files. They happened
occasionally with different files on different machines. I don't know
your MMF implementation, but when it tries to map the whole file at
once, it needs a continuous block of memory and when your are working for
some time the memory of your machine might get fragmented so that the
allocation fails.
If this is the reason for your occasional errors you may want to try to
change your MMF implementation so that it only maps a part of the file
to memory and shift this 'window' around.

Hope that helps.

Oliver

smith smithson wrote:
> I'm trying to use boost serialization to
> serialize/deserialize data to and from a mmap'd file.
> I have my own ostream/istream classes that essentially read/write
> bytes from a mmap'd file. The process works fine except on some rare
> occasions (With different objects/number of objects), in which case
> boost throws a "stream error" exception. Any ideas what could trigger
> this? A search of the Boost archives indicated other people had the
> same problem, where the solution was "use binary mode when you open
> the file"... but I'm not using a file on disk, I'm using a mmap'd
> file. (As a side note, the mmap file is large enough to hold all my
> data and does not need to be expanded or remmap'd etc)
>
> The OS i'm using is Linux.
>
> Thanks for any suggestions...
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net