[issue3792] Module variable overridden in child processes with multiprocessing
New submission from Steve Smith <[EMAIL PROTECTED]>: The process variable 'p' is leaking into sub-processes when using the multiprocessing modules. The following code demonstrates the problem: import sys from multiprocessing import Process p = 'Correct' def test(): print "Got 'p' of", p if __name__ == '__main__': if len(sys.argv) == 2 and sys.argv[1] == '-m': p = Process(target=test) p.start() p.join() else: test() Running this in SP and MP mode shows the leakage: ssmith$ /opt/python-svn/bin/python mpbug.py Got 'p' of Correct ssmith$ /opt/python-svn/bin/python mpbug.py -m Got 'p' of This occurs in both 2.6b3 and trunk. -- components: Library (Lib) messages: 72662 nosy: TarkaSteve severity: normal status: open title: Module variable overridden in child processes with multiprocessing type: behavior versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3792> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3792] Module variable overridden in child processes with multiprocessing
Steve Smith <[EMAIL PROTECTED]> added the comment: Ugh, sorry. Stupidity on the reporter's part. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3792> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3831] Multiprocessing: Expose underlying pipe in queues
New submission from Steve Smith <[EMAIL PROTECTED]>: Both Connection and Pipe objects expose their underlying file descriptors, which is useful for accessing them in an event-driven manner. However the higher-level Queue does not make the underlying pipe available; to get at them you must access private member attributes which is fragile. It would be good to have a well-defined API for accessing either the pipe objects or the underlying FDs. -- components: Extension Modules messages: 73001 nosy: TarkaSteve severity: normal status: open title: Multiprocessing: Expose underlying pipe in queues type: feature request versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3831> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3831] Multiprocessing: Expose underlying pipe in queues
Steve Smith <[EMAIL PROTECTED]> added the comment: Hi Jesse, The use-case I had is mind is enabling asyncronous (i.e. select() style) notification of data being available on the queue, which is more elegant (and efficient) than polling with get(). Example code showing how this works with GTK is available here: http://haltcondition.net/?p=2319 I understand wanting to keep the API simple, however the underlying posix-level file-descriptors for pipes and connections are already exposed via fileno(); the actual API change would just be a matter of changing '_reader' and '_writer' to 'reader' and 'writer' (implicitly guaranteeing their consistency). Would it help if I attached a patch showing the proposed change to the module? I realise the API is frozen now but it would be nice to have this further down the line. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3831> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com