Boost logo

Boost :

Subject: [boost] [RFC] C++ apparently lacks a mechanism for locking ranges of a shared resource
From: Raphael S Carvalho (raphael.scarv_at_[hidden])
Date: 2016-02-19 21:23:34


I am very sorry if this topic is unrelated to the topics covered by this
mailing list.

While developing a small project which consists of exporting a blockv
device via network (if you are curious: https://github.com/raphaelsc/blockv),
there was the need to lock a range of a shared resource, such as a file. I
searched for resources coming from C++ standard library and boost library,
but I wasn't able to find anything that would fit my needs. Am I missing
something?

Anyway, I ended up implementing my own range locking mechanism. The
implementation is quite simple, feel free to look it at:
https://github.com/raphaelsc/byte-range-lock-cpp/blob/master/range_lock.hh
(I made my best effort to document it well)

Is there any chance that something like range_lock will be made available
in the next versions of boost library?

Thank you very much for reading this,

Raphael Carvalho


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk