• 1 Post
  • 16 Comments
Joined 1 year ago
cake
Cake day: June 2nd, 2023

help-circle






  • DaPorkchop_@lemmy.mltoMemes@lemmy.mltwenty-six
    ·
    6 months ago

    I mean, I get what you're saying, but the Internet Archive has limited resources as it is and doesn't appreciate being used as a CDN. They've said as much themselves on various occasions



  • DaPorkchop_@lemmy.mltoprogrammingThe Worst API Ever Made
    ·
    6 months ago

    It's pretty uncommon for low-level system APIs to use callbacks in that way. Think about it: every time the kernel wants to notify the user of an event, it would have to call a function in userspace... but there are a few problems with that. For starters: which thread is it calling from? The user process isn't going to have stack mappings and whatnot set up for an arbitrary kernel thread. And if we set that aside for the time being, in order to actually run the callback, you'd have to make a context switch from kernel to user mode as well, for each event.

    The kind of API shown in the example is much more common: userspace allocatesa buffer, makes a syscall to request the kernel to copy queued events into the buffer until it fills up or no more events are pending, and then iterate over them again in userspace. A higher-level userspace library might hide this away behind a simplified interface with a callback function, but somewhere down the abstraction hierarchy it's almost certainly going to end up looking something like this.


  • DaPorkchop_@lemmy.ml
    hexagon
    toLinux@lemmy.mlbcachefs is now in linux-next!
    ·
    9 months ago

    Yeah, although the neat part is that you can configure how much replication it uses on a per-file basis: for example, you can set your personal photos to be replicated three times, but have a tmp directory with no replication at all on the same filesystem.