阅读背景:

Ruby Array#[] =预分配数组的线程安全吗?这可以锁定吗?

来源:互联网 

I've written some code in ruby to process items in an array via a threadpool. In the process, I've preallocated a results array which is the same size as the passed-in array. Within the threadpool, I'm assigning items in the preallocated array, but the indexes of those items are guaranteed to be unique. With that in mind, do I need to surround the assignment with a I've written some code in ruby to process items




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: