| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
absolute timeout_time, avoiding deadlocks
Classes affected incl. API change using fraction for relative time
- latch
- ringbuffer
- service_runner
- simple_timer
|
|
|
|
|
|
| |
Add notion of operating threading mode for more efficancy:
- One producer-thread and one consumer-thread (default)
- Multiple producer-threads and multiple consumer-threads
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`use_memset` non-type template param use `use_memcpy`
- ringbuffer API change: Drop whole `NullValue` *angle*, simplifying
- Drop `Value_type [get|peek]*()`, use `bool [get|peek]*(Value_type&)` instead
- Use `bool` return to determine success and `Value_type` reference as storage.
- Drop `NullValue_type` template type param and `NullValue_type` ctor argument.
- Simplifies and unifies single and multi get and put, as well as testing (motivation).
- ringbuffer: Drop `use_memset` non-type template param,
simply use `use_memcpy` having same semantics of *TriviallyCopyable*
- favor ::memcpy over ::memmove if applicable
don't confuse with our `use_memmove` semantics :)
- Use proper 'void*' cast to lose const'ness, drop non-required 'void*' cast for source (memmove)
- Use global namespace ::memmove and ::explicit_bzero
|
|
|
|
| |
freeSlots()
|
|
|
|
|
|
|
|
| |
count to wait for, return actual received elements
Receiving `min(dest_len, getSize()>=min_count)` elements is most efficient for receiver code.
This is aligned with new/changed 'waitForElements(..)' and 'waitForFreeSlots(..)' methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
decoupling for complex ..
Changed typename 'T' to 'Value_type' for readability.
Using a dedicated typename 'NullValue_type', denoting the type for 'nullelem'.
Distinguishing the 'nullelem' NullValue_type from Value_type
is required for special Value_type assignment like 'std::unique_ptr<T>'.
In the latter case, we can't assign or copy 'std::unique_ptr<T>' as 'nullelem',
but have to use 'nullptr'. Hence using std::nullptr_t for NullValue_type.
This finally resolved the 'nullelem' custom setup
as started in commit 50534c737b6fa540f958b2ad638890e257479722.
|
|
|
|
|
|
|
|
|
|
|
| |
Having the `nullelem` passed as reference as a template parameter
gives user the burden to have a static instance setup before declaration.
This is not nice.
For now, we better pass `nullelem` via the constructor.
We would like to pass `T nullelem` as a non-type template parameter of type `T`, a potential Class.
However, this is only allowed in C++20 and we use C++17 for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
non-value-range-collision get*(..) variant
Support block access
=======================
- Add support for bulk get*(..) and put*(..) operations.
- In case 'T' is Trivially_Copyable, memcpy is used for performance to copy values.
- In case 'T' is an integral, memset is used for performance to remove data.
Support integral types
=======================
- Passing 'nullelem' as 'const T& nullelem' instead of 'std::nullptr'
Support non-value-range-collision get*(..) variant
==================================================
Provide get*(..) variant returning 'bool' to signal clear success
in cases where the 'T' value range doesn't provide a 'failure' value,
i.e. 'nullelem'.
Implementation details
========================
- Remove 'size', as we are required to determine race-free size by R and W position for block access
- Use 'syncWrite' for write-operations (put*), i.e. modifying the writePos.
- Use 'syncRead' for read-operations (get*), i.e. modifying the readPos.
- Reorderd method in order
-- peek, get and put
Test Coverage
================
- test_lfringbuffer01: Trivial + Integral (byte array)
- test_lfringbuffer02: Trivial + !Integral (Integer array)
- test_lfringbuffer03: !Trivial + !Integral (shared_ptr<Integer> array)
- test_lfringbuffer[11-13] covers same order for concurrency tests
All tests cover sequential and bulk/range get and put operations
|
| |
|
|
|
|
| |
versatile functionality (benchmarking, ..)
|
|
|
|
|
|
| |
element count and size semantics.
This refines commit 0814f8212ac1ec19fef79d8ed55a162d3d8583f3, supporting less invasize size types like nsize_t.
|
|
|
|
| |
semantics.
|
|
|