From 66dd2bead468c581d736feabff11372500ee8400 Mon Sep 17 00:00:00 2001 From: Jenkins nedprod CI Date: Fri, 8 Jun 2018 13:03:21 +0000 Subject: Travis CI updates documentation --- ...io__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1memory__map.html | 2 +- classafio__v2__xxx_1_1io__service.html | 4 ++-- config_8hpp.html | 2 +- index.html | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/classafio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1memory__map.html b/classafio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1memory__map.html index fdc3340b..c60f7d90 100644 --- a/classafio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1memory__map.html +++ b/classafio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1memory__map.html @@ -277,7 +277,7 @@ template<template< class > class Hasher = QUICKCPPLIB_NAMESPACE::algori

Initialises a shared filing system mutex using the file at lockfile.

Errors returnable
Awaiting the clang result<> AST parser which auto generates all the error codes which could occur, but a particularly important one is errc::no_lock_available which will be returned if the lock is in use by another computer on a network.
-
191  {
192  AFIO_LOG_FUNCTION_CALL(0);
193  try
194  {
195  OUTCOME_TRY(ret, file_handle::file(base, lockfile, file_handle::mode::write, file_handle::creation::if_needed, file_handle::caching::reads));
196  file_handle temph;
197  // Am I the first person to this file? Lock everything exclusively
198  auto lockinuse = ret.try_lock(_initialisingoffset, 2, true);
199  if(lockinuse.has_error())
200  {
201  if(lockinuse.error() != errc::timed_out)
202  {
203  return lockinuse.error();
204  }
205  // Somebody else is also using this file, so try to read the hash index file I ought to use
206  lockinuse = ret.lock(_lockinuseoffset, 1, false); // inuse shared access, blocking
207  if(!lockinuse)
208  {
209  return lockinuse.error();
210  }
211  byte buffer[65536];
212  memset(buffer, 0, sizeof(buffer));
213  OUTCOME_TRYV(ret.read(0, {{buffer, 65535}}));
214  path_view temphpath(reinterpret_cast<filesystem::path::value_type *>(buffer));
215  result<file_handle> _temph(in_place_type<file_handle>);
216  _temph = file_handle::file({}, temphpath, file_handle::mode::write, file_handle::creation::open_existing, file_handle::caching::temporary);
217  // If temp file doesn't exist, I am on a different machine
218  if(!_temph)
219  {
220  // Release the exclusive lock and tell caller that this lock is not available
221  return errc::no_lock_available;
222  }
223  temph = std::move(_temph.value());
224  // Map the hash index file into memory for read/write access
225  OUTCOME_TRY(temphsection, section_handle::section(temph, HashIndexSize));
226  OUTCOME_TRY(temphmap, map_handle::map(temphsection, HashIndexSize));
227  // Map the path file into memory with its maximum possible size, read only
228  OUTCOME_TRY(hsection, section_handle::section(ret, 65536, section_handle::flag::read));
229  OUTCOME_TRY(hmap, map_handle::map(hsection, 0, 0, section_handle::flag::read));
230  return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
231  }
232 
233  // I am the first person to be using this (stale?) file, so create a new hash index file in /tmp
235  OUTCOME_TRY(_temph, file_handle::random_file(tempdirh));
236  temph = std::move(_temph);
237  // Truncate it out to the hash index size, and map it into memory for read/write access
238  OUTCOME_TRYV(temph.truncate(HashIndexSize));
239  OUTCOME_TRY(temphsection, section_handle::section(temph, HashIndexSize));
240  OUTCOME_TRY(temphmap, map_handle::map(temphsection, HashIndexSize));
241  // Write the path of my new hash index file, padding zeros to the nearest page size
242  // multiple to work around a race condition in the Linux kernel
243  OUTCOME_TRY(temppath, temph.current_path());
244  char buffer[4096];
245  memset(buffer, 0, sizeof(buffer));
246  size_t bytes = temppath.native().size() * sizeof(*temppath.c_str());
247  file_handle::const_buffer_type buffers[] = {{reinterpret_cast<const byte *>(temppath.c_str()), bytes}, {reinterpret_cast<const byte *>(buffer), 4096 - (bytes % 4096)}};
248  OUTCOME_TRYV(ret.truncate(65536));
249  OUTCOME_TRYV(ret.write({buffers, 0}));
250  // Map for read the maximum possible path file size, again to avoid race problems
251  OUTCOME_TRY(hsection, section_handle::section(ret, 65536, section_handle::flag::read));
252  OUTCOME_TRY(hmap, map_handle::map(hsection, 0, 0, section_handle::flag::read));
253  /* Take shared locks on inuse. Even if this implementation doesn't implement
254  atomic downgrade of exclusive range to shared range, we're fully prepared for other users
255  now. The _initialisingoffset remains exclusive to prevent double entry into this init routine.
256  */
257  OUTCOME_TRY(lockinuse2, ret.lock(_lockinuseoffset, 1, false));
258  lockinuse = std::move(lockinuse2); // releases exclusive lock on all three offsets
259  return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
260  }
261  catch(...)
262  {
263  return error_from_exception();
264  }
265  }
Cache reads only. Writes of data and metadata do not complete until reaching storage (O_SYNC)...
+
208  {
209  AFIO_LOG_FUNCTION_CALL(0);
210  try
211  {
212  OUTCOME_TRY(ret, file_handle::file(base, lockfile, file_handle::mode::write, file_handle::creation::if_needed, file_handle::caching::reads));
213  file_handle temph;
214  // Am I the first person to this file? Lock everything exclusively
215  auto lockinuse = ret.try_lock(_initialisingoffset, 2, true);
216  if(lockinuse.has_error())
217  {
218  if(lockinuse.error() != errc::timed_out)
219  {
220  return lockinuse.error();
221  }
222  // Somebody else is also using this file, so try to read the hash index file I ought to use
223  lockinuse = ret.lock(_lockinuseoffset, 1, false); // inuse shared access, blocking
224  if(!lockinuse)
225  {
226  return lockinuse.error();
227  }
228  byte buffer[65536];
229  memset(buffer, 0, sizeof(buffer));
230  OUTCOME_TRYV(ret.read(0, {{buffer, 65535}}));
231  path_view temphpath(reinterpret_cast<filesystem::path::value_type *>(buffer));
232  result<file_handle> _temph(in_place_type<file_handle>);
233  _temph = file_handle::file({}, temphpath, file_handle::mode::write, file_handle::creation::open_existing, file_handle::caching::temporary);
234  // If temp file doesn't exist, I am on a different machine
235  if(!_temph)
236  {
237  // Release the exclusive lock and tell caller that this lock is not available
238  return errc::no_lock_available;
239  }
240  temph = std::move(_temph.value());
241  // Map the hash index file into memory for read/write access
242  OUTCOME_TRY(temphsection, section_handle::section(temph, HashIndexSize));
243  OUTCOME_TRY(temphmap, map_handle::map(temphsection, HashIndexSize));
244  // Map the path file into memory with its maximum possible size, read only
245  OUTCOME_TRY(hsection, section_handle::section(ret, 65536, section_handle::flag::read));
246  OUTCOME_TRY(hmap, map_handle::map(hsection, 0, 0, section_handle::flag::read));
247  return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
248  }
249 
250  // I am the first person to be using this (stale?) file, so create a new hash index file in /tmp
252  OUTCOME_TRY(_temph, file_handle::random_file(tempdirh));
253  temph = std::move(_temph);
254  // Truncate it out to the hash index size, and map it into memory for read/write access
255  OUTCOME_TRYV(temph.truncate(HashIndexSize));
256  OUTCOME_TRY(temphsection, section_handle::section(temph, HashIndexSize));
257  OUTCOME_TRY(temphmap, map_handle::map(temphsection, HashIndexSize));
258  // Write the path of my new hash index file, padding zeros to the nearest page size
259  // multiple to work around a race condition in the Linux kernel
260  OUTCOME_TRY(temppath, temph.current_path());
261  char buffer[4096];
262  memset(buffer, 0, sizeof(buffer));
263  size_t bytes = temppath.native().size() * sizeof(*temppath.c_str());
264  file_handle::const_buffer_type buffers[] = {{reinterpret_cast<const byte *>(temppath.c_str()), bytes}, {reinterpret_cast<const byte *>(buffer), 4096 - (bytes % 4096)}};
265  OUTCOME_TRYV(ret.truncate(65536));
266  OUTCOME_TRYV(ret.write({buffers, 0}));
267  // Map for read the maximum possible path file size, again to avoid race problems
268  OUTCOME_TRY(hsection, section_handle::section(ret, 65536, section_handle::flag::read));
269  OUTCOME_TRY(hmap, map_handle::map(hsection, 0, 0, section_handle::flag::read));
270  /* Take shared locks on inuse. Even if this implementation doesn't implement
271  atomic downgrade of exclusive range to shared range, we're fully prepared for other users
272  now. The _initialisingoffset remains exclusive to prevent double entry into this init routine.
273  */
274  OUTCOME_TRY(lockinuse2, ret.lock(_lockinuseoffset, 1, false));
275  lockinuse = std::move(lockinuse2); // releases exclusive lock on all three offsets
276  return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
277  }
278  catch(...)
279  {
280  return error_from_exception();
281  }
282  }
Cache reads only. Writes of data and metadata do not complete until reaching storage (O_SYNC)...
io_handle::io_result< io_handle::buffers_type > read(io_handle &self, io_handle::io_request< io_handle::buffers_type > reqs, deadline d=deadline()) noexcept
Read data from the open handle.
Definition: io_handle.hpp:483
const path_handle & storage_backed_temporary_files_directory() noexcept
Returns a reference to an open handle to a verified temporary directory where files created are store...
const path_handle & memory_backed_temporary_files_directory() noexcept
Returns a reference to an open handle to a verified temporary directory where files created are store...
diff --git a/classafio__v2__xxx_1_1io__service.html b/classafio__v2__xxx_1_1io__service.html index dba852d5..9b6adbaa 100644 --- a/classafio__v2__xxx_1_1io__service.html +++ b/classafio__v2__xxx_1_1io__service.html @@ -282,7 +282,7 @@ template<class U >

Schedule the callable to be invoked by the thread owning this object and executing run() at its next available opportunity. Unlike any other function in this API layer, this function is thread safe.

-
286 { _post(detail::make_function_ptr<void(io_service *)>(std::forward<U>(f))); }
+
288 { _post(detail::make_function_ptr<void(io_service *)>(std::forward<U>(f))); }
@@ -309,7 +309,7 @@ template<class U >

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

-
277 { return run_until(deadline()); }
virtual result< bool > run_until(deadline d) noexcept
+
279 { return run_until(deadline()); }
virtual result< bool > run_until(deadline d) noexcept
diff --git a/config_8hpp.html b/config_8hpp.html index 4d148355..f7a2dd54 100644 --- a/config_8hpp.html +++ b/config_8hpp.html @@ -365,7 +365,7 @@ template<class R , class U , class... Args>
-Value:
{ \
AFIO_V2_NAMESPACE::log().emplace_back(QUICKCPPLIB_NAMESPACE::ringbuffer_log::level::fatal, (message), AFIO_V2_NAMESPACE::detail::unsigned_integer_cast<unsigned>(inst), QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id(), (AFIO_LOG_BACKTRACE_LEVELS & (1U << 1U)) ? nullptr : __func__, __LINE__); \
AFIO_LOG_FATAL_TO_CERR(message); \
}
QUICKCPPLIB_NAMESPACE::ringbuffer_log::simple_ringbuffer_log< AFIO_LOGGING_MEMORY > & log() noexcept
The log used by AFIO.
Definition: config.hpp:747
+Value:
{ \
AFIO_V2_NAMESPACE::log().emplace_back(QUICKCPPLIB_NAMESPACE::ringbuffer_log::level::fatal, (message), AFIO_V2_NAMESPACE::detail::unsigned_integer_cast<unsigned>(inst), QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id(), (AFIO_LOG_BACKTRACE_LEVELS & (1U << 1U)) ? nullptr : __func__, __LINE__); \
AFIO_LOG_FATAL_TO_CERR(message); \
}
QUICKCPPLIB_NAMESPACE::ringbuffer_log::simple_ringbuffer_log< AFIO_LOGGING_MEMORY > & log() noexcept
The log used by AFIO.
Definition: config.hpp:752
#define AFIO_LOG_BACKTRACE_LEVELS
Bit mask of which log levels should be stack backtraced which will slow those logs thirty fold or so...
Definition: config.hpp:70
diff --git a/index.html b/index.html index c1d980ca..7e277549 100644 --- a/index.html +++ b/index.html @@ -107,7 +107,10 @@ $(document).ready(function(){initNavTree('index.html','');});
  • Will make use of any Concepts TS if you have them.
  • async_file_handle supports co_await (Coroutines TS).
  • Provides view adapters into the Ranges TS, so ready for STL2.
  • -
  • Original error code is always preserved, even down to the original NT kernel error code if a NT kernel API was used.
  • +
  • Original error code is always preserved, even down to the original NT kernel error code if a NT kernel API was used.
      +
    • Optional configuration based on P1028 SG14 status_code and standard error object for P0709 Zero-overhead deterministic exceptions.
    • +
    +
  • Race free filesystem design used throughout (i.e. no TOCTOU).
  • Zero malloc, zero exception throw and zero whole system memory copy design used throughout, even down to paths (which can hit 64Kb!).
  • Works very well with the C++ standard library, and is intended to be proposed for standardisation into C++ in Summer 2018.
  • -- cgit v1.2.3