Skip to main content
6 votes

How is async implemented natively?

Well, "async" is an umbrella term and different pieces of async, over different runtimes are implemented in different ways. For network i/o typically such runtime would take advantage of ...
freakish's user avatar
  • 3,085
4 votes
Accepted

Can the operating system "break up" a memory allocation (Linux)?

If the process asks for 100MB, there has to be a contiguous 100MB free in the address space of the process (virtual memory), but those addresses can be mapped to non-contiguous pages of physical ...
amon's user avatar
  • 136k
4 votes

Feasibility of adding drivers to linux kernel

This is not a "philosophy of Linux", it's a fact of life: over time, new hardware is invented, and needs new software to interface with it. This is true of every OS, in proportion to the ...
IMSoP's user avatar
  • 5,957
4 votes
Accepted

Feasibility of adding drivers to linux kernel

I have question regarding Linux kernel, as far as I understand, to make Linux compatible with different machines and hardware, different device driver is added to the Linux That is correct, but the ...
Bart van Ingen Schenau's user avatar
4 votes

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

I'm not a parallelism expert, but here's what concerns me.  If there are multiple producers, then there is a race condition by the > 0 test and the wake/decrement. Let's say there is only one ...
Erik Eidt's user avatar
  • 34.8k
4 votes

What does the inode point to in case of a device file other than the disk?

Of course this depends on the file system, but in traditional UNIX filesystems a device node contains a type indicator (block or character device) and a major and minor number. In the kernel, the ...
Hans-Martin Mosner's user avatar
3 votes

What security practices do I employ when building a library that requires low level root access to certain devices and files?

The first thing you'll have to understand about the risks introduced by this design you have to consider what root can do that normal users can't. A user in the root group can do a great number of ...
Berin Loritsch's user avatar
3 votes

How is async implemented natively?

In the context of io_uring, it's important to recognize that block device I/O operations are inherently asynchronous: requests are sent over PCIe or whatever bus, and some time later a response is ...
Useless's user avatar
  • 12.9k
3 votes

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

I don't know what language/library you're using here, but for most, you're working at least two levels of abstraction too low. For keeping a count and blocking when the count is too low, you would ...
Karl Bielefeldt's user avatar
2 votes
Accepted

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

Is it cleaner to decrement the reader counter in the producer, after it does the waking, or the reader, after it wakes? The cleanest code is code where you can read it and tell confidently if it is ...
Bart van Ingen Schenau's user avatar
2 votes

Can the operating system "break up" a memory allocation (Linux)?

Asking about RAM is wrong, what counts is address space. If your OS is using virtual memory (which is most likely the case), then the mapping of address space to RAM is arbitrary and can change at any ...
gnasher729's user avatar
  • 49.4k
1 vote
Accepted

What does the inode point to in case of a device file other than the disk?

One thing you should understand is that the on-disk inode structure is rarely identical to the in-memory inode structure. What data is stored in an on-disk inode depends on the filesystem. But yes, it ...
Alex D's user avatar
  • 1,308

Only top scored, non community-wiki answers of a minimum length are eligible