home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fd98b77
)
Add main thread profiling hint.
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 3 Dec 2020 01:17:53 +0000
(
02:17
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 3 Dec 2020 01:17:53 +0000
(
02:17
+0100)
plomrogue/io.py
patch
|
blob
|
history
diff --git
a/plomrogue/io.py
b/plomrogue/io.py
index 8110647647b1a809692949220135cf7eb9c4679d..8cba18d7a483664047b3601890fec3df2c4490a9 100644
(file)
--- a/
plomrogue/io.py
+++ b/
plomrogue/io.py
@@
-43,7
+43,18
@@
class GameIO():
via self.queue from connected servers' clients."""
self.queue = queue.Queue()
via self.queue from connected servers' clients."""
self.queue = queue.Queue()
+
+ # optionally use this for main thread profiling:
+ # import cProfile
+ # class ProfiledThread(threading.Thread):
+ # def run(self):
+ # profiler = cProfile.Profile()
+ # profiler.runcall(threading.Thread.run, self)
+ # print('profiled thread finished')
+ # profiler.dump_stats('profile')
+ # c = ProfiledThread(target=self.loop, args=(self.queue,))
c = threading.Thread(target=self.loop, args=(self.queue,))
c = threading.Thread(target=self.loop, args=(self.queue,))
+
c.start()
def start_server(self, port, server_class, certfile=None, keyfile=None):
c.start()
def start_server(self, port, server_class, certfile=None, keyfile=None):