Re:Ask HN: Do you feel bad when devices aren't utilized to t...
by itake on Friday December 02, 2022 @12:30PM
(#33833637)
My issue is concurrency is so hard. One time tasks don't make sense to make concurrent, b/c migrating from sync to async takes 2-5x longer + higher bug risks and more complexity.
So most tasks remain inefficient...
Re:Ask HN: Do you feel bad when devices aren't utilized to t...
by thoughtFrame on Friday December 02, 2022 @12:35PM
(#33833730)
And a lot of concurrency resources just dump a list of tools on you. Just saying "here's a spinlock, here's a monitor, here's a condition variable, here's the definition of Dining Philosophers" is like teaching woodworking by just showing you a bunch of powertools without any explanation of how you make furniture out of them
Re:Ask HN: Do you feel bad when devices aren't utilized to t...
by itake on Friday December 02, 2022 @07:09PM
(#33838711)
I really liked golang's blog on pipelines:
Re:Ask HN: Do you feel bad when devices aren't utilized to t...
by vineyardmike on Friday December 02, 2022 @01:48PM
(#33834925)
> b/c migrating from sync to async takes 2-5x longer
I very firmly believe that the future of concurrency is with language features that let you basically “write blocking code and run it in parallel” like fibers/CSP/etc. It’s how I’ve started pushing everyone to write where I work and it’s made everyone so much more comfortable (and error free) at writing things in parallel.
It’s way easier to reason about than async+await/callbacks/etc. It fits with how people thing about sequential programs, and it’s how the operating systems most people use expose concurrency today.
Re:Ask HN: Do you feel bad when devices aren't utilized to t...
by itake on Friday December 02, 2022 @05:20PM
(#33837745)
I write a lot of golang now. Golang has the easiest to use concurrency model of any language I've used (js, java, c#, ruby, python), but to perform any task properly, still requires fine-tuning (e.g. how many threads/go-routines do you use per stage in the pipeline?). Implementing a pipeline still adds ~15 additional lines per stage when compared to the sync version.
I push ppl at my job to write concurrent code, but we also work on high traffic systems at slow moving company and its better to do it fast the first time.
So I don't have a problem with, say, writing a script in Python even though it's not the most efficient use of my CPU, because I'm just looking to get things done. But when I have a problem that needs horsepower (and I know my 8 core 3.6 GHz can absolutely deliver that), I don't know how to tell it to do it. It doesn't help that many programmers' first thought would be to go for the cloud, when a single computer can be much faster than a bunch of AWS VMs
Another example is the .kkrieger demo, which seems like wizardry when you've only seen similar things done in Unity/Unreal