开发者

In stackless python, is data sent over a channel immutable?

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 implici开发者_Go百科t copy when sending the data over the channel?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜