Question on multiple Python users in one application

Paul Rubin no.email at nospam.invalid
Thu Oct 6 21:52:45 EDT 2016


"Loren Wilton" <myspamacct at earthlink.net> writes:
> I've read that Python supports 'threads', and I'd assumed (maybe
> incorrectly) that these were somewhat separate environments that could
> be operating concurrently (modulo the GC lock). I assume that data can
> be shared between the threads,

Threads all run in the same address space.  Data "can be" shared is an
understatement--it IS shared, so threads can interfere with each other
very easily.  You have to be quite careful to prevent that, and thread
programming has a reputation for being difficult for that reason.

> Would using threads help me do what I want? 

I don't think Python threads are the answer.  You want a separate
interpreter per user, which is annoying to do with CPython.  Do you have
concrete performance expectations about the sharing of data between
interpreter sessions?  Those old mainframes were very slow compared to
today's machines, even counting Python's interpretation overhead.



More information about the Python-list mailing list