-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a brief note about threads and multiprocessing, #281
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
docgen/programming_guide/threading_and_multiprocessing.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=========================================== | ||
A few tips on threading and multiprocessing | ||
=========================================== | ||
|
||
* be familiarized with cocos and pyglet in single threaded code before attempting threads or subprocess | ||
* consider to use events and timers instead of threads or subproces | ||
* multiprocessing: import cocos and pyglet only in one process, see `issue #281 <https://github.com/los-cocos/cocos/issues/281>`_ | ||
* threading | ||
|
||
- the gui thread must be the main thread | ||
- cocos code is not reentrant or thread-safe; call it only from the gui thread | ||
- use a queue to communicate with the gui thread; in the gui thread schedule a function to poll (non-blocking) the queue and dispatch as events | ||
* The pyglet and cocos google groups have a few threads relevant, search there for 'threading' or 'subprocess' | ||
|
||
|
||
|