LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-27-2010, 03:48 PM   #1
kvm1983
Member
 
Registered: Jul 2009
Posts: 47

Rep: Reputation: 0
file consistency using mmap


Hello all,
How can I achieve file consistency while using mmap? I have a block of code that needs synchronized access across processes (not threads). Using threads, one can regulate access to the mmaped portion of the file by locking it using a mutex. How can I achieve the same using different processes, some of which run in different programs?

Thanks,
Kshitij
 
Old 07-29-2010, 12:48 AM   #2
greplinux
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 17
Have you tried using semaphores?

Thanks,
 
Old 07-31-2010, 01:37 AM   #3
kvm1983
Member
 
Registered: Jul 2009
Posts: 47

Original Poster
Rep: Reputation: 0
I am not sure how I would use a semaphore to coordinate processes running under different programs. Place the semaphore in a shared memory segment ?

Thanks,
Kshitij
 
  


Reply

Tags
mmap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty in writing in a file through mapping using MMAP puneet193128 Programming 1 11-18-2009 02:59 PM
[SOLVED] Creating an 8GB file using mmap: error calling lseek() to stretch the file kvm1983 Programming 3 07-29-2009 03:10 PM
how to mmap file in kernel module shreyasw Linux - Newbie 3 09-25-2008 01:04 AM
mmap for device file problem? advanxiang Linux - Software 0 04-16-2008 03:21 AM
Advice: consistency in file system permissions tisource Linux - General 1 08-15-2005 06:15 PM


All times are GMT -5. The time now is 12:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration