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
416e9ccf
Commit
416e9ccf
authored
Dec 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f248b5a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
7 deletions
+45
-7
zloadrace.py
zloadrace.py
+43
-5
zopenrace.py
zopenrace.py
+2
-2
No files found.
zloadrace.py
View file @
416e9ccf
...
...
@@ -53,20 +53,58 @@ def main():
def
C1
(
ctx
,
N
):
# XXX
pass
def
c1
():
transaction
.
begin
()
zconn
=
db1
.
open
()
root
=
zconn
.
root
()
obj1
=
root
[
'obj1'
]
obj2
=
root
[
'obj2'
]
# obj1 - reload it from zstor
# obj2 - get it from zconn cache
for
i
in
range
(
10
*
N
):
obj1
.
_p_invalidate
()
# both objects must have the same values
i1
=
obj1
.
i
i2
=
obj2
.
i
if
i1
!=
i2
:
raise
AssertionError
(
"C1: obj1.i (%d) != obj2.i (%d)"
%
(
i1
,
i2
))
transaction
.
abort
()
zconn
.
close
()
for
i
in
range
(
N
):
print
(
'C1.%d'
%
i
)
c1
()
def
C2
(
ctx
,
N
):
# XXX
pass
def
c2
():
transaction
.
begin
()
zconn
=
db2
.
open
()
root
=
zconn
.
root
()
obj1
=
root
[
'obj1'
]
obj2
=
root
[
'obj2'
]
obj1
.
i
+=
1
obj2
.
i
+=
1
assert
obj1
.
i
==
obj2
.
i
transaction
.
commit
()
zconn
.
close
()
for
i
in
range
(
N
):
print
(
'C2.%d'
%
i
)
c2
()
init
()
N
=
100
0
N
=
100
wg
=
sync
.
WorkGroup
(
context
.
background
())
wg
.
go
(
C1
,
N
)
wg
.
go
(
C2
,
N
)
...
...
zopenrace.py
View file @
416e9ccf
...
...
@@ -150,9 +150,9 @@ def main():
i1
=
obj1
.
i
i2
=
obj2
.
i
if
i1
!=
i2
:
raise
AssertionError
(
"
t
1: obj1.i (%d) != obj2.i (%d)"
%
(
i1
,
i2
))
raise
AssertionError
(
"
T
1: obj1.i (%d) != obj2.i (%d)"
%
(
i1
,
i2
))
transaction
.
commit
()
transaction
.
abort
()
# we did not changed anything; also fails with commit
zconn
.
close
()
for
i
in
range
(
N
):
...
...
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