-1

I need a library (C/C++) that handles the basic operations of a low level pager layer on disk. The library must include methods to get a disk page, add data, write the page to disk etc.

To give a bit of background: Assume there's a particular dataset which runs query q. I have a particular grouping of the data on disk so that q can be processed faster. This library will help me write the data in pages, according to the grouping.

Appreciate any suggestions.

kami
  • 361
  • 3
  • 15
  • This would be operating system dependent, it doesn't have C++ method. I don't know why you think it would be faster. – Barmak Shemirani Jun 26 '15 at 06:04
  • Are you speaking about [virtual memory pages](https://en.wikipedia.org/wiki/Paging) (usually handled by the operating system) or just about data blocks in your file? – dlask Jun 26 '15 at 06:31
  • @dlask I'm talking about data blocks or pages on the disk (not memory pages) – kami Jun 26 '15 at 07:47
  • Than what's your actual problem? Such file block operations can be easily implemented using `fseek`, `fread` and `fwrite` functions, for example. – dlask Jun 26 '15 at 07:49
  • I'm pretty sure there's no library that does this, so I'm not going to vote to close this as an off-topic software recommendation. – MSalters Jun 26 '15 at 08:59

1 Answers1

0

You don't specify the OS, but that doesn't really matter: all common OS'es bar this outright. Instead, use a memory-mapped file. To read a page from disk, just read from memory and the OS will (if needed) perform a disk read. Writing to disk will be mostly on-demand but usually can be done explicitly on demand.

As for your "dataset running query q", that just doesn't make sense. Queries are code not data. Do you perhaps have a query Q run over a dataset D?

MSalters
  • 173,980
  • 10
  • 155
  • 350