5 ms·
pygame does a lot of its threaded graphics, and sound work entirely in C world, because python threads are so limited. Some of us have been using mmapd surface
by illumen 17y ago
pygame does a lot of its threaded graphics, and sound work entirely in C world, because python threads are so limited.
Some of us have been using mmapd surfaces with python/pygame for years though. For graphical work, it's not all that hard to share data with python. You can use the same approaches with numpy. See this cookbook example: http://www.pygame.org/wiki/MmapSurfaces http://www.pygame.org/wiki/MmapSurfaces it's only a dozen lines of code to share data via mmap. There are lots of issues with the python, and numpy mmap modules though... and mmap is very different across platforms (eg, linux, windows, macosx have quite different behaviour).
Another approach good for some graphics problems is forking. Forking is pretty fast, and it allows you to share memory in a fairly nice way. However mixing forking and threading is a quite tricky with python. This is also not so good on windows - mainly its a good method on *nix.
cu,
- gte910h 17y agoI'd love a good windows fork.....win7 hasn't implemented it yet I'm guessing?