Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython_lwan_coro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython_lwan_coro
Commits
3c9a6a6c
Commit
3c9a6a6c
authored
Jan 02, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sleep 1 second after finish the work in each thread
parent
5e4bb136
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
wrapper.pyx
wrapper.pyx
+4
-0
No files found.
wrapper.pyx
View file @
3c9a6a6c
from
lwan_coro
cimport
scheduler_t
,
scheduler_init
,
scheduler_coro_add
,
scheduler_run
,
scheduler_destroy
,
coro_yield_value
,
coro_yield
,
coro_t
from
lwan_coro
cimport
scheduler_t
,
scheduler_init
,
scheduler_coro_add
,
scheduler_run
,
scheduler_destroy
,
coro_yield_value
,
coro_yield
,
coro_t
from
libc.stdio
cimport
printf
from
libc.stdio
cimport
printf
cdef
extern
from
"unistd.h"
nogil
:
unsigned
int
sleep
(
unsigned
int
seconds
)
cdef
class
SomeMemory
nogil
:
cdef
class
SomeMemory
nogil
:
cdef
int
a
;
cdef
int
a
;
cdef
int
b
;
cdef
int
b
;
...
@@ -8,6 +11,7 @@ cdef class SomeMemory nogil:
...
@@ -8,6 +11,7 @@ cdef class SomeMemory nogil:
while
self
.
a
<
4
:
while
self
.
a
<
4
:
self
.
a
+=
1
self
.
a
+=
1
printf
(
"%d
\
n
"
,
self
.
a
)
printf
(
"%d
\
n
"
,
self
.
a
)
sleep
(
1
)
def
main
():
def
main
():
cdef
:
cdef
:
...
...
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