Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
e84c6c32
Commit
e84c6c32
authored
Feb 20, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9d667aec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+21
-8
No files found.
wcfs/client/wcfs.cpp
View file @
e84c6c32
...
...
@@ -50,8 +50,8 @@
// Conn.atMu > Conn.mu > FileH.mu
//
// Several locks are RWMutex instead of just Mutex not only to allow more
// concurrency, but, in the first place for correctness: pinner
being core
// element in handling WCFS isolation protocol, is effectively invoked
// concurrency, but, in the first place for correctness: pinner
thread being
//
core
element in handling WCFS isolation protocol, is effectively invoked
// synchronously from other threads via messages coming through wcfs server.
// For example Conn.resync sends watch request to wcfs and waits for the
// answer. Wcfs server, in turn, sends corresponding pin messages to the pinner
...
...
@@ -66,7 +66,6 @@
// - - - - - -
// client process
//
//
// This creates the neccessity to use RWMutex for locks that pinner and other
// parts of the code could be using at the same time in sychronous mode similar
// to the above. This locks are:
...
...
@@ -139,6 +138,12 @@ pair<Conn, error> WCFS::connect(zodb::Tid at) {
// FIXME ^^^ not right - Conn.open waits for wcfs/head/at only in the end
// and stats head/f to get f.headfsize _before_ that.
// -> just wait here.
// XXX atMu.RLock ?
err
=
wconn
.
_headWait
(
at
);
if
(
err
!=
nil
)
{
// XXX bring conn down - stop pinner
return
make_pair
(
nil
,
E
(
err
));
}
return
make_pair
(
wconn
,
nil
);
}
...
...
@@ -626,8 +631,20 @@ error _Mapping::unmap() {
// XXX place=? -> closer to pinner & connect
error
_Conn
::
resync
(
zodb
::
Tid
at
)
{
_Conn
&
wconn
=
*
this
;
error
err
;
wconn
.
_atMu
.
Lock
();
xerr
::
Contextf
E
(
"%s: resync -> @%s"
,
v
(
wconn
),
v
(
at
));
wconn
.
_atMu
.
Unlock
();
// XXX downErr -> E
// XXX at ^ (increases)
// first wait for wcfs/head to be >= at
err
=
wconn
.
_headWait
(
at
);
if
(
err
!=
nil
)
return
err
;
// FIXME first wait for wcfs/head to be >= at
// write-lock wconn._atMu . This excludes everything else, and in
// particular _pinner_, from running and mutating files and mappings.
...
...
@@ -646,10 +663,6 @@ error _Conn::resync(zodb::Tid at) {
wconn
.
_atMu
.
RUnlock
();
});
xerr
::
Contextf
E
(
"%s: resync -> @%s"
,
v
(
wconn
),
v
(
at
));
error
err
;
err
=
wconn
.
_downErr
;
if
(
err
!=
nil
)
return
E
(
err
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment