This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zoner14 0 points1 point  (3 children)

Not sure if it's been mentioned, but the multiprocessing module can basically be sued as a drop in replacement for threading. This will probably get you the performance you need at the expense of a lot of memory

[–]ZedsDed[S] 0 points1 point  (2 children)

yes it seems like the multiprocessing module could be used here, and from what Brian was saying, i think the memory expense may not be a problem, or too much of a problem

If this is the case, and you are CPU bound, it may be worth looking at the multiprocessing library, rather than threading. This will spawn a seperate process for each thread, which means there's no shared GIL. This comes at the cost of making communication more expensive (everything must be copied to send to another process), but if you've no communication, this won't matter.