Elektrine lite

← Feed

@pkce@mastodon.gamedev.place

Post #2085711

2023-08-08 02:36 UTC

@sunfish I'll take this over co/contravariance any day. Parallelism: multiple things happening at the same time Concurrency: written in such a way that tasks could interleave safely All parallel programs are concurrent but not all concurrent programs are parallel :D or. something.

Replies (2)

  • @pkce@mastodon.gamedev.place 2023-08-08 02:39

    @sunfish An analogy - when making food, many steps can be run concurrently - you might prepare some vegetables, then stop, turn the hob on and put some meat on, then go back to preparing vegetables, etc. You can perform each task _concurrently_ - they can be interleaved. But since there's only _one_ of you, you alone cannot prepare two separate meals worth of vegetables at the same time on one chopping board (or you shouldn't) - that would be parallelism

    Open ##2085712

  • @muvlon@hachyderm.io 2023-08-28 11:25

    @pkce @sunfish Confusingly, what you call "concurrency" is what a bunch of people call "concurrency control": https://en.wikipedia.org/wiki/Concurrency_control That is, concurrency represents uncertainty about ordering of operations and concurrency control is how you keep it in check and ensure safety. Under that view, not every parallel program is concurrent. SIMD for example is parallelism but it does not involve uncertainty and therefore needs no concurrency control.

    Open ##2085713