Question

I have a typical producer, consumer pattern. If the producer sends an object over a channel, the producer is blocked until the consumer accepts the object. After the consumer accepts the object, the producer alters the object in some way. Does the consumer see the object get altered? Or was there an implicit copy when sending the data over the channel?

Was it helpful?

Solution

Stackless sends a reference to the python object over the channel, so any changes the producer makes to the object will be "seen" by the consumer. No copying going on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top