News for hackers. Stuff that matters.
Re:How JavaScript works: Event loop and the rise of Async pr... by signa11 on Saturday October 14, 2017 @12:57PM (#15473008)
> Threads do scale. On Linux, O(1) scheduler solved this non-issue a long time ago.

yup they do.

till you start making sure that your code doesn't end up with deadlock, data-corruption, races, performance issues due to lock-contention etc. etc. designing efficient locking schemes is notoriously hard alternating between:

- too coarse grained : resulting in serializing activities which could have (should have) proceeded in parallel, thereby sacrificing performance and scalability.

or

- too fine grained: with space+time for lock operations sapping performance, error recovery and not to mention understanding etc. etc.

In the former we have the dragons of deadlock and livelock roaming freely, and in the latter we have race conditions. Somewhere in between is a razor's edge which is both efficient and correct.

Almost always, things start with ‘one big lock around everything’ and the vague hope that performance might not be abysmal. When that is dashed, big lock gets broken up, and the prayer is repeated. Each iteration increasing complexity and decreasing lock-contention, and hopefully with some luck, modest performance gain as well.

remember this:

What do we want ?

Now !

When do we want it ?

Fewer race conditions !

have fun :)

Re:How JavaScript works: Event loop and the rise of Async pr... by throwme211345 on Saturday October 14, 2017 @08:52PM (#15475213)
I see your design is lacking and your fud quotient is high. Good on you!
Re:How JavaScript works: Event loop and the rise of Async pr... by cheez on Sunday October 15, 2017 @01:10PM (#15478004)
Yep. This was my reaction as well. Threads are fine.