mmap and munmap question/problem (under iOS, proably no important)
Thanks for any suggestions or comments! David _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.app... This email sent to site_archiver@lists.apple.com 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!
participants (1)
-
David Hoerl