Releases: SlickQuant/slick-queue-py
Releases · SlickQuant/slick-queue-py
Release v1.1.0
Changes
Breaking Changes
- BREAKING:
read_last()return signature changed fromOptional[bytes]toTuple[Optional[bytes], int]- Now returns
(data, size)tuple wheresizeindicates the number of slots the item occupies - Migration: Change
data = q.read_last()todata, size = q.read_last() - Provides actual slot size information instead of always returning full
element_size
- Now returns
Added
- Modern format support with efficient
last_published_atomic tracking- New
last_published_atomic field at offset 16 for O(1)read_last()performance - Header magic number
0x534C5131('SLQ1') at offset 24 for format detection - Init state atomic at offset 48 for CAS-based ownership detection
- Automatic format detection distinguishes modern vs legacy queues
- New
- CAS-based queue ownership detection matching C++ implementation (queue.h:618-648)
- Helper methods
_wait_for_shared_memory_ready()and_detect_format_version() - Comprehensive test suites:
test_read_last.py: 10 tests covering empty queue, single/multiple items, multi-slot publishes, concurrent publishes, reset, shared memory, wraparound, variable sizestest_read_last_interop.py: 5 tests for Python ↔ C++ interoperabilitytest_modern_format.py: 6 tests for format compatibility and memory layout verification
- C++ test program
cpp_read_last_tester.cppfor read_last() interoperability testing - New constants:
SIZE_OFFSET,ELEMENT_SIZE_OFFSET,LAST_PUBLISHED_OFFSET,HEADER_MAGIC_OFFSET,HEADER_MAGIC,INIT_STATE_OFFSET,INIT_STATE_*,K_INVALID_INDEX - Documentation:
READ_LAST_INTEROP.mdcomprehensive interoperability guide
Changed
- Updated shared memory header layout to match C++ slick-queue v1.x:
- Reserved info: 8 bytes at offset 0-7 (compact from previous 32-byte padded format)
- Size: 4 bytes at offset 8-11 (moved from offset 32)
- Element size: 4 bytes at offset 12-15 (moved from offset 36)
- Last published: 8 bytes at offset 16-23 (NEW)
- Header magic: 4 bytes at offset 24-27 (NEW)
- Init state: 4 bytes at offset 48-51 (NEW)
publish()now updateslast_published_atomic using CAS loop in modern format (queue.h:331-337)reset()now resetslast_published_toK_INVALID_INDEXwhen in modern formatclose()properly releases_atomic_last_publishedwrapperAtomicReservedInfo.RESERVED_INFO_FMTsimplified from 32-byte to 8-byte format- Repository name changed from slick_queue_py to slick-queue-py
- Updated README.md with new
read_last()API documentation - Enhanced CMakeLists.txt with new test targets
Fixed
read_last()now returns actual slot size instead of always returning fullelement_size- Test queue names shortened to comply with macOS 31-character shared memory name limit
Performance
- O(1)
read_last()via direct atomic load (improved from reserved_info calculation) - Reduced header size: 8-byte reserved_info vs 32-byte padded (24 bytes saved)
- Lock-free
last_published_tracking enables efficient concurrent access
Compatibility
- Backward Compatible: Automatically detects and supports legacy queue format
- C++ Interop: Full compatibility with C++ slick-queue modern format
- Python and C++ can share queues created by either language
- All existing tests continue to pass (atomic ops, cursors, local mode, multi-producer, interop)
Release v1.0.1
Changes
Fixed
- Fixed extra
/prefix being added to shared memory names on POSIX systems (Linux/macOS) - Fixed test failures on Linux and macOS platforms
Added
- macOS shared memory name length validation (31 character limit including
/prefix) - C++ extension support for Linux/macOS platforms with automatic fallback to native methods if unavailable
atomic_store_64andatomic_cas_64functions to C++ extension for improved cross-platform consistency
Changed
- Linux/macOS now prioritize C++ extension for atomic operations, falling back to native methods (
__sync_val_compare_and_swaporlibatomic) if extension is not available - Improved atomic operation reliability across all platforms
- Enhanced test suite for better cross-platform compatibility