mmap and munmap question/problem (under iOS, proably no important)
mmap and munmap question/problem (under iOS, proably no important)
- Subject: mmap and munmap question/problem (under iOS, proably no important)
- From: David Hoerl <email@hidden>
- Date: Sat, 04 Feb 2012 10:14:29 -0500
I have a huge file with which I use mmap to bring in selected pieces.
When done, I then munmap the piece.
However, my code is threaded, and I am getting crashes which I
**believe** at this moment to be related to munmap. Specifically, if two
threads map pieces in which overlap, the first munmap appears to unmap
the area used by the second thread, and boom, down goes my app.
If I'm correct in this assumption, then it occurred to me that if I
could chunk my memory such that no two pieces would appear on the same
page, the problem would go away. The only other alternative I've thought
of is just queuing all munmap calls until such time that all threads finish.
Sooo - is there better solution to the above. I've used mmap before, but
am no expert by any means!
Thanks for any suggestions or comments!
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden