* * *

Author Topic: How to use map file in Lazarus installed on Debian?  (Read 2293 times)

safa

  • New member
  • *
  • Posts: 17
How to use map file in Lazarus installed on Debian?
« 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
It's never too late, it's never too early, it's always the right moment.

Septe

  • Jr. Member
  • **
  • Posts: 68
Re: How to use map file in Lazarus installed on Debian?
« Reply #1 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.

molly

  • Hero Member
  • *****
  • Posts: 2037
Re: How to use map file in Lazarus installed on Debian?
« Reply #2 on: January 06, 2016, 11:17:54 pm »
OP is clearly talking about a memory mapped file (or filemapping as MS calls it), as his description talks about multiple threads wanting to access the same data.

I was able to find this. 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.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5875
Re: How to use map file in Lazarus installed on Debian?
« Reply #3 on: January 06, 2016, 11:21:57 pm »
The mmap call is available in baseunix as "fpmmap"

safa

  • New member
  • *
  • Posts: 17
Re: How to use map file in Lazarus installed on Debian?
« Reply #4 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 (or filemapping as MS calls it), as his description talks about multiple threads wanting to access the same data.

I was able to find this. 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
It's never too late, it's never too early, it's always the right moment.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus