MantisWaffle

joined 2 years ago
[–] MantisWaffle 1 points 3 months ago (1 children)

Feel free to elaborate.

[–] MantisWaffle 2 points 6 months ago

Interesting, that's my experience with anesthesia.

[–] MantisWaffle 1 points 6 months ago (1 children)

I thought it was "you're not the boss of me now".

[–] MantisWaffle 2 points 8 months ago* (last edited 8 months ago)

https://m.youtube.com/watch?v=HFLW1853Abg&pp=ygUVdGlvbiBlbGVjdHJpYyBjb21wYW55 Show made songs for kids and taught spelling.

There was also a pbskids show with the same name https://www.pbslearningmedia.org/collection/the-electric-company/t/tec-full-episodes/

Which also had a tion song though I can't find the episode right now.

[–] MantisWaffle 1 points 9 months ago* (last edited 9 months ago) (1 children)

I offered help and disagreed with what you said that was wrong. Your response is unrelated and misinterprets my reply.

[–] MantisWaffle 8 points 9 months ago (4 children)

I disagree, Cargo is very simple and easy to use for developers. I agree, binaries are easier for end users. I'm surprised cargo run --release didn't work for you. What was the project and OS?

[–] MantisWaffle 1 points 11 months ago (1 children)

Because the kernel doesn’t like you spawning 100k threads.

Why do you say this?

Your RAM doesn’t, either

Not if your stacks per thread are small.

Even all the stacks aside, the kernel needs to record everything in data structures which now are bigger and need longer to traverse.

These data structures must exist either in userland or the kernel. Moving them to the kernel won't help anything. Also, many of these data structures scale at log(n). Splitting have the elements to userland and keeping the other half gives you two structures with log(n/2) so 2log(n/2) = log(n^2/4). Clearly that's worse.

Each thread is a process which could e.g. be sent a signal, requiring keeping stuff around that rust definitely doesn’t keep around (async functions get compiled to tight state machines).

If signals were the reason async worked better, then the correct solution is to enable threads that opt-out of signals. Anything that slows down threads that isn't present in an async design should be opt-out-able. The state-machines that async compiles to, do not appear inherently superior to multiple less stateful threads managed by a fast scheduler.

Specifically with io_uring: You can fire off quite a number of requests, not incurring a context switch ...

As described here you would still need to do a switch to kernel mode and back for the syscalls. The extra work required from assuming processes are hostile to each other should be easy to avoid among threads known to have a common process as they are obviously not hostile to each other and share memory space anyway. The synchronization required to handle multiple tasks should be the same regardless if they are being run on the same thread by a user land scheduler or if they are running on multiple threads with an os scheduler.

Anyhow, your mode of inquiry is fundamentally wrong in the first place: ...

I'm not interested in saying that async is the best because it appears to work well currently. That's not the right way to decide the future of how to do things. That's just a statement of how things are. I agree, if your only goal is get the fastest thing now with no critical thought, then it does appear that async is faster. I am unconvinced it must fundamentally be the case.

[–] MantisWaffle 0 points 11 months ago

Threads are callbacks.

[–] MantisWaffle 1 points 11 months ago* (last edited 11 months ago) (2 children)

You cant say async is the fundamentally better model because threading is purposely crippled in the browser.

The conversation at hand is not "how do io in browser". Its "async is not inherently better than threads"

[–] MantisWaffle 2 points 11 months ago* (last edited 11 months ago) (3 children)

I assume by performance you mean CPU usage per io request. Each io call should require a switch to the kernel and back. When you do blocking io the switch back is delayed(switch to other threads while waiting), but not more taxing. How could it be possible for there to be a difference?

view more: next ›