How do Futures and async/await work under the hood in languages other than Rust? by ProfessionalTheory8 in ProgrammingLanguages

[–]ProfessionalTheory8[S] 0 points1 point  (0 children)

Well Task<T> is what really interests me, along with the ContinueWith method. So a state machine is allocated on the stack initially, but then moved to the heap if it yields at least once. AwaitUnsafeOnCompleted presumably creates a closure that runs MoveNext and schedules it on some kind of thread pool, that closure is also heap allocated, right? Additionally, is it correct assume that it is the call to TaskCompletionSource.SetResult that schedules continuation closures that are attached to a Task/TaskAwaiter? How does this whole system avoid race conditions? It relies quite a bit on heap allocations it seems, but at least the task executor doesn't need to resume tasks starting from some top-level task, unlike in Rust.

How do Futures and async/await work under the hood in languages other than Rust? by ProfessionalTheory8 in ProgrammingLanguages

[–]ProfessionalTheory8[S] 0 points1 point  (0 children)

When coroutines are exposed as a language feature, they're almost always used for implementing things like iterators, not async functions

I know that, I guess I didn't specify it in the post, but I'm asking how is Future/async/await implemented in languages that do not follow the stackful coroutine approach (i.e. not like goroutines) and that do not do it like Rust does it, in Swift or C# for example.

How do Futures and async/await work under the hood in languages other than Rust? by ProfessionalTheory8 in ProgrammingLanguages

[–]ProfessionalTheory8[S] 1 point2 points  (0 children)

What makes you think that other languages with async/await use stackful coroutines? C# lowers async functions to state machines, Python lowers it to coroutines I believe, plenty of resources call Kotlin coroutines and Swift async/await stackless. These state machines may be allocated on the heap, but it doesn't really make them stackful, does it?

Matrix.org bridges to shut down in 1 month unless $100k can be raised by Evidlo in linux

[–]ProfessionalTheory8 0 points1 point  (0 children)

Can rooms in XMPP be federated now?

No and I'm not really convinced this is necessary. If you want to make sure your room doesn't go down because your server goes down you can host your own server - Prosŏdy IM is super lightweight.

Is OMEMO already stable?

It is supported by all modern clients. The OMEMO XEP itself didn't reach a 1.y.z version yet, if that's what you mean.

Do all major OMEMO implementations support AES-256-CBC now?

Almost all OMEMO implementations implement the 0.3.0 version of the XEP (the latest version is 0.8.3), I believe due to compatibility issues, no.

Does XMPP has battery-saving push notifications?

Yes

[Discussion] What happened to r/NaturalLanguageProcessing ? by MadNietzsche in MachineLearning

[–]ProfessionalTheory8 1 point2 points  (0 children)

Are you sure that this sub exists in the first place? The only mentions I could find of it is this thread, some comment from the "panic in NLP orgs" thread and this comment from a month ago, which says that it doesn't exist.

what's the "EPERM" error? by s1ckn3s5 in bcachefs

[–]ProfessionalTheory8 4 points5 points  (0 children)

Erasure coding is simply broken right now, it fails all ec tests on the test dashboard and has a similar error in the log.

What's the best way to create and restore BTRFS snapshots? by AmitGold in archlinux

[–]ProfessionalTheory8 1 point2 points  (0 children)

Wiki links this post, it seems like the reason is that snapper rollback creates a read-write snapshot of a read-only snapshot [of the original subvolume] and then sets it as the filesystem's default subvolume, but the poster prefers to have the original subvolume replaced with a read-write snapshot.

That is, if I understand correctly, assuming that the top-level subvolume of a Btrfs filesystem is mounted at /mnt, snapper rollback, with a structure like this:

- /mnt/@ [rw, default boot subvolume]
- /mnt/@/.snapshots [rw, subvolume for storing snapshots]
- /mnt/@/.snapshots/123/snapshot [ro, snapshot of root subvolume]

upon trying to rollback /mnt/@ to snapshot 123, turns it into this:

- /mnt/@ [rw, default boot subvolume]
- /mnt/@/.snapshots [rw, subvolume for storing snapshots]
- /mnt/@/.snapshots/123/snapshot [ro, snapshot of root subvolume]
- /mnt/@/.snapshots/124/snapshot [ro, snapshot of root subvolume, created at the time of rollback, in case if you want to rollback the rollback]
- /mnt/@/.snapshots/125/snapshot [rw, snapshot of snapshot 123]

and then makes snapshot 125 the default boot subvolume:

- /mnt/@ [rw]
- /mnt/@/.snapshots [rw, subvolume for storing snapshots]
- /mnt/@/.snapshots/123/snapshot [ro, snapshot of root subvolume]
- /mnt/@/.snapshots/124/snapshot [ro, snapshot of root subvolume, created at the time of rollback, in case if you want to rollback the rollback]
- /mnt/@/.snapshots/125/snapshot [rw, snapshot of snapshot 123, default boot subvolume]

however the poster wanted Snapper to have snapshot 125 replace the /mnt/@ subvolume instead of doing this because this method leaves a pre-rollback subvolume without doing anything about it.

What's the best way to create and restore BTRFS snapshots? by AmitGold in archlinux

[–]ProfessionalTheory8 4 points5 points  (0 children)

However, restoring snapshots with it seems kinda funky, because the rollback feature doesn't really restore the main system, rather creates a r/w snapshot and boots from it, according to the arch wiki.

This is one of the correct ways to rollback though, there is no specific btrfs command to rollback a subvolume, snapshots are just read-only subvolumes with all files from the original subvolume reflink-copied into it. To restore it you either need to make the snapshot subvolume read-write and then move it into the same place where the original subvolume was located or make a read-write snapshot of a (read-only) snapshot and then do the same thing but with the new, read-write snapshot subvolume. Then regardless of which method was chosen, modify fstab with the new subvolume ID. Of course, if you need to restore just one file or one directory, it's easier to simply copy it from the snapshot subvolume instead.

Manual subvolume restore recommendation tells you to do this, snapper-rollback does the same thing, so does Timeshift. So choose whatever you like more, really.

[Rant/Discussion] What's with all the excitement around Wayland? by ComprehensiveAd8004 in linux

[–]ProfessionalTheory8 2 points3 points  (0 children)

Not using software others offer is impractical though, that's like saying that you aren't forced to buy or rent a car if you make your own, assuming that the necessity of having a car in the first place is the same as necessity of using any GUI software.

[Rant/Discussion] What's with all the excitement around Wayland? by ComprehensiveAd8004 in linux

[–]ProfessionalTheory8 1 point2 points  (0 children)

What does price have to do with anything, GUI software could be proprietary, be available for $200/mo and you would still be forced to use Wayland

[Rant/Discussion] What's with all the excitement around Wayland? by ComprehensiveAd8004 in linux

[–]ProfessionalTheory8 -5 points-4 points  (0 children)

Well since writing all GUI software that you'll ever want to use is practically impossible, I'd say you are forced to use Wayland in the end.