classification
Title: multiprocessing.dummy.Queue does not expose same interface as multiprocessing.Queue
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Jason.Baker, Thomas Fenzl, berker.peksag, davin, sbt, ysj.ray
Priority: normal Keywords:

Created on 2010-05-11 18:39 by Jason.Baker, last changed 2016-02-12 15:12 by davin.

Messages (3)
msg105533 - (view) Author: Jason Baker (Jason.Baker) Date: 2010-05-11 18:39
The multiprocessing.dummy.Queue class is merely an import of Queue.Queue.  There are a few methods that this does not provide however:  close, join_thread, and cancel_join_thread.

I don't know what the best way to handle this is, but it should be pretty trivial to add methods that do nothing or at least throw a NotImplementedError.
msg121507 - (view) Author: ysj.ray (ysj.ray) Date: 2010-11-19 10:08
+1 on make it identical to multiprossing.Queue. Since the documentation said:

multiprocessing.dummy replicates the API of multiprocessing but is no more than a wrapper around the threading module.

Does the word "replicates" implies that multiprossing.dummy.[AClass] should have the same interfaces as multiprossing.[AClass]? I think so. We should be able to use multiprossing.dummy.xxx wherever multiprossing.xxx can be used. We can just create a subclass of Queue.Queue and implemented these missing methods as dummy functions.

I wonder is there other inconsistence between multiprocessing.dummy and multiprocessing?
msg216548 - (view) Author: Thomas Fenzl (Thomas Fenzl) * Date: 2014-04-16 18:38
Considering public API elements, there are more inconsistencies. 
E.g. Pool:

'imap'
'apply'
'join'
'map_async'
'Process'
'terminate'
'close'
'starmap_async'
'starmap'
'apply_async'
'map'
'imap_unordered' : Pool misses some public elements.

What level of compatibility would users reasonably expect? Should the methods raise NotImplemented?
History
Date User Action Args
2016-02-12 15:12:44davinsetnosy: + davin
2016-01-21 11:42:47berker.peksagsetnosy: + berker.peksag
stage: needs patch
type: enhancement

versions: + Python 3.6, - Python 2.6, Python 3.1, Python 2.7, Python 3.2
2014-04-16 18:38:50Thomas Fenzlsetnosy: + sbt, Thomas Fenzl
messages: + msg216548
2010-11-19 10:08:27ysj.raysetnosy: + ysj.ray

messages: + msg121507
versions: + Python 3.1, Python 3.2
2010-05-11 18:39:42Jason.Bakercreate