[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: img-2024-08-29-14-17-10.png (214 KB, 1024x768)
214 KB
214 KB PNG
Just trying to cut through biased bullshit benchmarks, and walls of Reddit nonsense here:
Are Goroutines lighter than using asynchronous C++ in a framework like Drogon or not?

I don't want to start committing to an entire new language or particular framework just to find out way down the road that it was the inferior choice.
>>
Maybe.
>>
C++ coroutines are allocating dogshit unfit for any use. Worthless misfeature.
Unironically they should have copied Rust's async/await which is actually lightweight.
>>
>>102137825
What do you even _mean_ by lighter? Almost all programming languages can spawn OS threads, they're quite sufficient for workloads that aren't heavily concurrent. Some of them can _only_ do OS threads, like C# or Rust. You thus have N:N threads-- for every N amount of threads available, you can spawn N threads.
Languages which have a runtime AND have implemented green threads can spawn much, much more threads, (all JVM languages, all Erlang languages, Go) 2because they're managed by the runtime. When a green thread is pinned (blocking in general) the OS thread moves to another green thread to do that work. This gives them a distinct advantage for heavy concurrent workloads like web servers where your threads can take like 25 ns to handle the response (useful work) and 75ms waiting for one (wasted work, thread pinned) so the real OS thread can do more work while the green thread is blocked
>>
>>102137918
C++ already copied Rust's async/await by not having a working implementation for it.
>>
>>102138324
kek
>>
>>102138036
You are wrong about JVM. JVM Threads are OS threads they are not green threads. Only with JVM 21 it got green threads (so called virtual threads) and you have to specifically configure a thread to be one, the default when creating threads is still OS threads.
>>
>>102138036
Well supposedly a single OS thread is a lot more RAM than a "green thread" spawned by Go. Supposedly, by using Go, you get concurrency for a lot less RAM and a higher performance application also.
>>
>>102138324
well, you are not wrong
>>
>>102138324
Rust async / await works fine and is conceptually simple retard.
>>
>>102138687
hell yeah we ACKin 2nite
>>
>>102138393
Even before Loom, Java jeets had other tools to provide concurrency such as the proliferation of observer patterns in a lot of code and stuff like vert.x

Green threads aren't the only way to concurrently execute on a thread and in fact is probably the worst way of doing it unless you're a lazy jeet who can't code.
>>
>>102138477
It comes down to stackful vs stackless coroutines. There are pros and cons. Go uses stackful coroutines, which has the main benefit of not requiring async/await keywords.
>>
File: goph.jpg (32 KB, 512x756)
32 KB
32 KB JPG
The lighter the routine, the less things that can go wrong
>>
File: 82803824_p0.jpg (134 KB, 605x854)
134 KB
134 KB JPG
Speaking of memory leaks, I have quite a weird one I have yet to identify
>re-did a fresh win 10 install
>installed one program at a time
>waited hours for each to see if it happens
>doesn't happen even after installing everything
>a week or so later
>the leak starts happening again
It's driving me crazy at this point. And the weirdest of all is that every single exe and dll that runs on the system starts leaking leaving the "unused" part accumulate until it crashes making it hard to know what's causing it.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.