Lazarus

Programming => Operating Systems => Topic started by: safa on January 06, 2016, 06:58:09 pm

Title: How to use map file in Lazarus installed on Debian?
Post by: safa on January 06, 2016, 06:58:09 pm
I'm using lazarus installed on Debian and i need to use a map file in my application, but I can't find any tutorial online, to be clearer: I want to know how to create a map file, then use it in a multithreaded application, so a principal thread creates that file, then the secondary threads write data on it (so they copy data from a memorystream to a mapfile). I already used a mapfile in windows, but using it on linux is a bit different. Can anyone explain to me how to realise this task? Thanks for your replies
Title: Re: How to use map file in Lazarus installed on Debian?
Post by: Septe on January 06, 2016, 10:58:13 pm
Let me do a shot in the dark.  After much contemplation and searching the net plus the way you described your problem, I think you mean a type of data storage using mapped values.  Is this correct?  If it's not correct, then you need to tell us what you mean by map file?  Is it an actual map like what we use to find our way in the world?  Quake uses map files but I doubt it's that.  In any case, there's many cases as what a map file could be.  You're going to have to be very specific as to what you mean.
Title: Re: How to use map file in Lazarus installed on Debian?
Post by: molly on January 06, 2016, 11:17:54 pm
OP is clearly talking about a memory mapped file (https://en.wikipedia.org/wiki/Memory-mapped_file) (or filemapping as MS calls it (https://msdn.microsoft.com/en-us/library/windows/desktop/aa366556(v=vs.85).aspx)), as his description talks about multiple threads wanting to access the same data.

I was able to find this (https://www.safaribooksonline.com/library/view/linux-system-programming/0596009585/ch04s03.html). Maybe it helps as it uses some terminology and variables/functions that are specific to mapping files in linux, so perhaps that can help with the searches.
Title: Re: How to use map file in Lazarus installed on Debian?
Post by: marcov on January 06, 2016, 11:21:57 pm
The mmap call is available in baseunix as "fpmmap"
Title: Re: How to use map file in Lazarus installed on Debian?
Post by: safa on January 07, 2016, 12:27:56 am
Let me do a shot in the dark.  After much contemplation and searching the net plus the way you described your problem, I think you mean a type of data storage using mapped values.  Is this correct?  If it's not correct, then you need to tell us what you mean by map file?  Is it an actual map like what we use to find our way in the world?  Quake uses map files but I doubt it's that.  In any case, there's many cases as what a map file could be.  You're going to have to be very specific as to what you mean.
You can read molly's answer  to understand what I'm talking about  :)
OP is clearly talking about a memory mapped file (https://en.wikipedia.org/wiki/Memory-mapped_file) (or filemapping as MS calls it (https://msdn.microsoft.com/en-us/library/windows/desktop/aa366556(v=vs.85).aspx)), as his description talks about multiple threads wanting to access the same data.

I was able to find this (https://www.safaribooksonline.com/library/view/linux-system-programming/0596009585/ch04s03.html). Maybe it helps as it uses some terminology and variables/functions that are specific to mapping files in linux, so perhaps that can help with the searches.
In fact, I could only find tutos using C language, i'll try to understand, but i also found this: http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/onguard/source/ogproexe.pas  (http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/onguard/source/ogproexe.pas)
TinyPortal © 2005-2018