Re:Parallelism in Crystal
by aidenn0 on Friday September 06, 2019 @11:03PM
(#20901514)
That's nonsensical. There is surely at least as much synchronization overhead with 4 threads as with 2.
[ Parent
| on HN ]
If the overhead is X, and the amount of work that can be done ignoring it is Y, you have Y - X. If you double the amount of work that can be down, but overhead stays the same you have 2Y - X, which is more than 2(Y - X) = 2Y - 2X. You're over performing doubling by not having to double the synchronization cost.
Re:Parallelism in Crystal
by paulddraper on Saturday September 07, 2019 @12:09AM
(#20901730)
Not necessarily.
There can be overhead introduced between the "1 thread" and ">1 thread" cases.
Re:Parallelism in Crystal
by ricardobeat on Saturday September 07, 2019 @12:21PM
(#20904740)
From 1 -> 2 threads the overhead is introduced, if the cost is somewhat fixed, the gains from 2 -> 4 can be proportionally larger.