Welcome to mirror list, hosted at ThFree Co, Russian Federation.

classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html - github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e3d446ef8a8e70f91f4c1638290066ec2f1989b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LLFIO: llfio_v2_xxx::algorithm::shared_fs_mutex::byte_ranges Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LLFIO
   &#160;<span id="projectnumber">v2.00 late alpha</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">llfio_v2_xxx::algorithm::shared_fs_mutex::byte_ranges Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Many entity shared/exclusive file system based lock.  
 <a href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#details">More...</a></p>

<p><code>#include &quot;byte_ranges.hpp&quot;</code></p>
<div class="dynheader">
Inheritance diagram for llfio_v2_xxx::algorithm::shared_fs_mutex::byte_ranges:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.png" usemap="#llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::byte_5Franges_map" alt=""/>
  <map id="llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::byte_5Franges_map" name="llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::byte_5Franges_map">
<area href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html" title="Abstract base class for an object which protects shared filing system resources. " alt="llfio_v2_xxx::algorithm::shared_fs_mutex::shared_fs_mutex" shape="rect" coords="0,0,337,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a07654cbb20d589f13107e8b6d7d286c9"><td class="memItemLeft" align="right" valign="top"><a id="a07654cbb20d589f13107e8b6d7d286c9"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a> = <a class="el" href="structllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entity__type.html">shared_fs_mutex::entity_type</a></td></tr>
<tr class="memdesc:a07654cbb20d589f13107e8b6d7d286c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of an entity id. <br /></td></tr>
<tr class="separator:a07654cbb20d589f13107e8b6d7d286c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae93a3105a8dad7e76c9985a468b435c7"><td class="memItemLeft" align="right" valign="top"><a id="ae93a3105a8dad7e76c9985a468b435c7"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#ae93a3105a8dad7e76c9985a468b435c7">entities_type</a> = <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">shared_fs_mutex::entities_type</a></td></tr>
<tr class="memdesc:ae93a3105a8dad7e76c9985a468b435c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of a sequence of entities. <br /></td></tr>
<tr class="separator:ae93a3105a8dad7e76c9985a468b435c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae6ccd949eefecbcf8208420ad9c27cf3"><td class="memItemLeft" align="right" valign="top"><a id="ae6ccd949eefecbcf8208420ad9c27cf3"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#ae6ccd949eefecbcf8208420ad9c27cf3">byte_ranges</a> (const <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;)=delete</td></tr>
<tr class="memdesc:ae6ccd949eefecbcf8208420ad9c27cf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">No copy construction. <br /></td></tr>
<tr class="separator:ae6ccd949eefecbcf8208420ad9c27cf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbcdc531087ecffcae9b5d33481c0331"><td class="memItemLeft" align="right" valign="top"><a id="abbcdc531087ecffcae9b5d33481c0331"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#abbcdc531087ecffcae9b5d33481c0331">operator=</a> (const <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;)=delete</td></tr>
<tr class="memdesc:abbcdc531087ecffcae9b5d33481c0331"><td class="mdescLeft">&#160;</td><td class="mdescRight">No copy assignment. <br /></td></tr>
<tr class="separator:abbcdc531087ecffcae9b5d33481c0331"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9223706814fe3ddc1c6260408f643b4a"><td class="memItemLeft" align="right" valign="top"><a id="a9223706814fe3ddc1c6260408f643b4a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a9223706814fe3ddc1c6260408f643b4a">byte_ranges</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;&amp;o) noexcept</td></tr>
<tr class="memdesc:a9223706814fe3ddc1c6260408f643b4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor. <br /></td></tr>
<tr class="separator:a9223706814fe3ddc1c6260408f643b4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1b2a3e78554504aea37126f60e821e4"><td class="memItemLeft" align="right" valign="top"><a id="af1b2a3e78554504aea37126f60e821e4"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#af1b2a3e78554504aea37126f60e821e4">operator=</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &amp;&amp;o) noexcept</td></tr>
<tr class="memdesc:af1b2a3e78554504aea37126f60e821e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assign. <br /></td></tr>
<tr class="separator:af1b2a3e78554504aea37126f60e821e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaaad1f98c333683535167a9f8e4be469"><td class="memItemLeft" align="right" valign="top"><a id="aaaad1f98c333683535167a9f8e4be469"></a>
const <a class="el" href="classllfio__v2__xxx_1_1file__handle.html">file_handle</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#aaaad1f98c333683535167a9f8e4be469">handle</a> () const noexcept</td></tr>
<tr class="memdesc:aaaad1f98c333683535167a9f8e4be469"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the handle to file being used for this lock. <br /></td></tr>
<tr class="separator:aaaad1f98c333683535167a9f8e4be469"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef06d02d70a00b731afbc2a9190eec3e"><td class="memItemLeft" align="right" valign="top"><a id="aef06d02d70a00b731afbc2a9190eec3e"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#aef06d02d70a00b731afbc2a9190eec3e">unlock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a> entities, unsigned long long) noexcept final</td></tr>
<tr class="memdesc:aef06d02d70a00b731afbc2a9190eec3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unlock a previously locked sequence of entities. <br /></td></tr>
<tr class="separator:aef06d02d70a00b731afbc2a9190eec3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cdf15b69bf6f375ec7083d639f76358"><td class="memItemLeft" align="right" valign="top"><a id="a4cdf15b69bf6f375ec7083d639f76358"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a4cdf15b69bf6f375ec7083d639f76358">entity_from_buffer</a> (const char *buffer, size_t bytes, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:a4cdf15b69bf6f375ec7083d639f76358"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates an entity id from a sequence of bytes. <br /></td></tr>
<tr class="separator:a4cdf15b69bf6f375ec7083d639f76358"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb28aedaf5caa53e851165a4f1927207"><td class="memTemplParams" colspan="2"><a id="afb28aedaf5caa53e851165a4f1927207"></a>
template&lt;typename T &gt; </td></tr>
<tr class="memitem:afb28aedaf5caa53e851165a4f1927207"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#afb28aedaf5caa53e851165a4f1927207">entity_from_string</a> (const std::basic_string&lt; T &gt; &amp;str, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:afb28aedaf5caa53e851165a4f1927207"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates an entity id from a string. <br /></td></tr>
<tr class="separator:afb28aedaf5caa53e851165a4f1927207"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="memItemLeft" align="right" valign="top"><a id="a8d62fe0c18bcfb1ade9ff9c7bb00e70b"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a8d62fe0c18bcfb1ade9ff9c7bb00e70b">random_entity</a> (bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a cryptographically random entity id. <br /></td></tr>
<tr class="separator:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="memItemLeft" align="right" valign="top"><a id="ab33ccb32052633a55cb3bb5d1bbdf52b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#ab33ccb32052633a55cb3bb5d1bbdf52b">fill_random_entities</a> (span&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a> &gt; seq, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a sequence of entity ids with cryptographic randomness. Much faster than calling random_entity() individually. <br /></td></tr>
<tr class="separator:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc6284803080e42505ba812d4711bb74"><td class="memItemLeft" align="right" valign="top"><a id="adc6284803080e42505ba812d4711bb74"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#adc6284803080e42505ba812d4711bb74">lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a> entities, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d=<a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a>(), bool spin_not_sleep=false) noexcept</td></tr>
<tr class="memdesc:adc6284803080e42505ba812d4711bb74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock all of a sequence of entities for exclusive or shared access. <br /></td></tr>
<tr class="separator:adc6284803080e42505ba812d4711bb74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="memItemLeft" align="right" valign="top"><a id="a33dcc1d37df90ac5dd85a754f9ffce04"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a33dcc1d37df90ac5dd85a754f9ffce04">lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a> entity, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d=<a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a>(), bool spin_not_sleep=false) noexcept</td></tr>
<tr class="memdesc:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock a single entity for exclusive or shared access. <br /></td></tr>
<tr class="separator:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a051822a4942c7f45b0491ab4385aacd3"><td class="memItemLeft" align="right" valign="top"><a id="a051822a4942c7f45b0491ab4385aacd3"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a051822a4942c7f45b0491ab4385aacd3">try_lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a> entities) noexcept</td></tr>
<tr class="memdesc:a051822a4942c7f45b0491ab4385aacd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to lock all of a sequence of entities for exclusive or shared access. <br /></td></tr>
<tr class="separator:a051822a4942c7f45b0491ab4385aacd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a7f463e9235bb95ddd84b69e2642613"><td class="memItemLeft" align="right" valign="top"><a id="a5a7f463e9235bb95ddd84b69e2642613"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a5a7f463e9235bb95ddd84b69e2642613">try_lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a07654cbb20d589f13107e8b6d7d286c9">entity_type</a> entity) noexcept</td></tr>
<tr class="memdesc:a5a7f463e9235bb95ddd84b69e2642613"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to lock a single entity for exclusive or shared access. <br /></td></tr>
<tr class="separator:a5a7f463e9235bb95ddd84b69e2642613"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9d4bddc98b5f19171a7230811250cad0"><td class="memItemLeft" align="right" valign="top"><a id="a9d4bddc98b5f19171a7230811250cad0"></a>
static result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html#a9d4bddc98b5f19171a7230811250cad0">fs_mutex_byte_ranges</a> (const <a class="el" href="classllfio__v2__xxx_1_1path__handle.html">path_handle</a> &amp;base, <a class="el" href="classllfio__v2__xxx_1_1path__view.html">path_view</a> lockfile) noexcept</td></tr>
<tr class="memdesc:a9d4bddc98b5f19171a7230811250cad0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises a shared filing system mutex using the file at <em>lockfile</em>. <br /></td></tr>
<tr class="separator:a9d4bddc98b5f19171a7230811250cad0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a8f5cfcb9868c2581015e35399bc0e57b"><td class="memItemLeft" align="right" valign="top"><a id="a8f5cfcb9868c2581015e35399bc0e57b"></a>
virtual result&lt; void &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>_lock</b> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &amp;out, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d, bool spin_not_sleep) noexcept final</td></tr>
<tr class="separator:a8f5cfcb9868c2581015e35399bc0e57b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Many entity shared/exclusive file system based lock. </p>
<p>This is a simple many entity shared mutex. It works by locking in the same file the byte at the offset of the entity id. If it fails to lock a byte, it backs out all preceding locks, randomises the order and tries locking them again until success. Needless to say this algorithm puts a lot of strain on your byte range locking implementation, some NFS implementations have been known to fail to cope.</p>
<dl class="section note"><dt>Note</dt><dd>Most users will want to use <code>safe_byte_ranges</code> instead of this class directly.</dd></dl>
<ul>
<li>Compatible with networked file systems, though be cautious with older NFS.</li>
<li>Linear complexity to number of concurrent users.</li>
<li>Exponential complexity to number of entities being concurrently locked, though some OSs provide linear complexity so long as total concurrent waiting processes is CPU core count or less.</li>
<li>Does a reasonable job of trying to sleep the thread if any of the entities are locked.</li>
<li>Sudden process exit with lock held is recovered from.</li>
<li>Sudden power loss during use is recovered from.</li>
<li>Safe for multithreaded usage of the same instance.</li>
</ul>
<p>Caveats:</p><ul>
<li>When entities being locked is more than one, the algorithm places the contending lock at the front of the list during the randomisation after lock failure so we can sleep the thread until it becomes free. However, under heavy churn the thread will generally spin, consuming 100% CPU.</li>
<li>Byte range locks need to work properly on your system. Misconfiguring NFS or Samba to cause byte range locks to not work right will produce bad outcomes.</li>
<li>If your OS doesn't have sane byte range locks (OS X, BSD, older Linuxes) and multiple objects in your process use the same lock file, misoperation will occur. Use lock_files or share a single instance of this class per lock file in this case.</li>
<li>If you are on POSIX and the same process relocks an entity a second time, it will release everything on the first unlock. On Windows, the first unlock releases the exclusive lock and the second unlock will release the shared lock. </li>
</ul>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>include/llfio/v2.0/algorithm/shared_fs_mutex/<a class="el" href="byte__ranges_8hpp.html">byte_ranges.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacellfio__v2__xxx.html">llfio_v2_xxx</a></li><li class="navelem"><a class="el" href="namespacellfio__v2__xxx_1_1algorithm.html">algorithm</a></li><li class="navelem"><a class="el" href="namespacellfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex.html">shared_fs_mutex</a></li><li class="navelem"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1byte__ranges.html">byte_ranges</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>