Boost logo

Boost :

Subject: Re: [boost] Portable robust mutex an another try...
From: Ladislav Sopko (lsopko_at_[hidden])
Date: 2014-07-18 03:08:40


I did try to continue with */Ion Gaztanaga's /*idea of portable robust
I post my code and considerations in codereview.

I hope to find some one to discuss about.


> Hi,
> The portable mutex has been in dormant state for a long time, so thanks
> for recovering it ;-)
> It wasn't further developed and I think your proposal could be an
> improvement, although I still don't like the preallocation of a 4MB
> file. I have no much time lately to review and add improvements to
> Interprocess, but please add this link or the patch to a boost trac
> ticket or as a GitHub pull request so that this is not forgotten when I
> find some time.
> Best,
> Ion

    Allocation of that 4MB is small fee for much better performance,
    because continuous
    search of files on disk slow it down really hard. Then I think to
    extend it with time stamp as

    Niall Douglas wrote. I just need atomic CAS for 64bit. Cause the
    time stamp and process ID
    must be changed in one shot. Then I can skip many robust checks, if
    the time from last lock
    is shorter than some predefined interval. So many regular locks will
    neither test
    file lock and it will run faster. In case one process die, there
    will be expired
    timeout and lock candidate will go check file lock.
    I'll check if I can add a 64bit CAS in
    boost\interprocess\detail\atomic.hpp. (if you know
    how it should be done, it will be a big help for me, cause I have
    not a lot of practice in atomic portable world.)


Sopko Ladislav
3D Informatica, Via Speranza 35,
40068, S.Lazzaro di Savena - Bologna, Italy
Tel: +39051450844 | Fax: +39051451942
Documentation: -
FTP:, Download:/3di, Upload:/incoming
Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenuti in questo messaggio sono riservate e ad uno esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.
Privacy Information - This message, for the D. Lgs m. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addessee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thanks you for your cooperation.

Boost list run by bdawes at, gregod at, cpdaniel at, john at