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
6efddbf0
Commit
6efddbf0
authored
Jun 19, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e563a4e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
wcfs/internal/wcfs_test.pyx
wcfs/internal/wcfs_test.pyx
+4
-3
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+5
-5
No files found.
wcfs/internal/wcfs_test.pyx
View file @
6efddbf0
...
@@ -34,12 +34,13 @@ from cpython.pystate cimport PyGILState_Ensure, PyGILState_Release, PyGILState_S
...
@@ -34,12 +34,13 @@ from cpython.pystate cimport PyGILState_Ensure, PyGILState_Release, PyGILState_S
cdef
extern
from
"Python.h"
:
cdef
extern
from
"Python.h"
:
int
PyRun_SimpleString
(
const
char
*
)
int
PyRun_SimpleString
(
const
char
*
)
# read0_nogil accesses mem[0] with GIL released and returns first byte read from there.
# read_nogil reads mem with GIL released and returns its content.
def
read0_nogil
(
const
unsigned
char
[::
1
]
mem
not
None
)
->
int
:
def
read_nogil
(
const
unsigned
char
[::
1
]
mem
not
None
)
->
bytes
:
assert
len
(
mem
)
==
1
,
"read_nogil: only [1] mem is supported for now"
cdef
unsigned
char
b
cdef
unsigned
char
b
with
nogil
:
with
nogil
:
b
=
mem
[
0
]
b
=
mem
[
0
]
return
b
return
b
ytes
(
bytearray
([
b
]))
# ---- signal handling ----
# ---- signal handling ----
...
...
wcfs/wcfs_test.py
View file @
6efddbf0
...
@@ -42,7 +42,7 @@ from zodbtools.util import ashex as h, fromhex
...
@@ -42,7 +42,7 @@ from zodbtools.util import ashex as h, fromhex
from
pytest
import
raises
from
pytest
import
raises
from
six
import
reraise
from
six
import
reraise
from
.internal
import
mm
from
.internal
import
mm
from
.internal.wcfs_test
import
read
0
_nogil
,
install_sigbus_trap
from
.internal.wcfs_test
import
read_nogil
,
install_sigbus_trap
# setup:
# setup:
# - create test database, compute zurl and mountpoint for wcfs
# - create test database, compute zurl and mountpoint for wcfs
...
@@ -579,11 +579,11 @@ class tFile:
...
@@ -579,11 +579,11 @@ class tFile:
# access data with released GIL so that the thread that reads data from
# access data with released GIL so that the thread that reads data from
# head/watch can receive pin message. Be careful to handle cancelation,
# head/watch can receive pin message. Be careful to handle cancelation,
# so that on error in another worker we don't
stuck and the error can
# so that on error in another worker we don't
get stuck and the
# be propagated to wait and reported.
#
error can
be propagated to wait and reported.
have_read
=
chan
(
1
)
have_read
=
chan
(
1
)
def
_
():
def
_
():
b
=
read
0_nogil
(
blkview
)
b
=
read
_nogil
(
blkview
[
0
:
1
]
)
have_read
.
send
(
b
)
have_read
.
send
(
b
)
t
.
tdb
.
_blkaccess
(
t
.
zf
,
blk
)
t
.
tdb
.
_blkaccess
(
t
.
zf
,
blk
)
go
(
_
)
go
(
_
)
...
@@ -595,7 +595,7 @@ class tFile:
...
@@ -595,7 +595,7 @@ class tFile:
raise
ctx
.
err
()
raise
ctx
.
err
()
b
=
_rx
b
=
_rx
ev
.
append
(
'read '
+
chr
(
b
)
)
ev
.
append
(
'read '
+
b
)
ev
=
doCheckingPin
(
_
,
pinokByWLink
)
ev
=
doCheckingPin
(
_
,
pinokByWLink
)
# XXX hack - wlinks are notified and emit events simultaneously - we
# XXX hack - wlinks are notified and emit events simultaneously - we
...
...
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