Funny argument in class today and was curious what you lot thought, cuz Im honestly not sure who was right. student argued false. professor said true.


(True or False): A preemptive kernel is safe from race conditions on kernel data structures.

  • 5
    how the kernel makes multitasking has nothing to do with concurrent access to data structures. to make it safe a locking has to be done.
  • 3
    @stop yeah that's why I put false on this question, but he marked it as wrong. a few other students had concerns - but the professor insisted "none of us would win the argument" that a preemptive kernel isn't safe from race conditions.

    he kept saying IF it's built right - IF this that etc etc. Which is why I'm so confused. The question itself seems false, but he appeared to have injected some invisible condition not present in the question.
  • 4
    too many ifs. i would escalate this.
  • 2
    an question or group of questions need to provide all informatiin needed. todays kernel are not 100% safe for irregular access, so why should we expect a ideal system?
  • 3
    “If the code is perfect, with perfect data, in a perfect world, it won’t have any problems”

    Well, duh. If everything is perfect, everything is perfect.

    Good luck writing that “perfect” kernel, though, and having everything happen perfectly.

    I mean, to be fair, with enough overhead you could absolutely handle every possible issue and edge case, deduce the cause of and desired behavior behind every crash and recover gracefully, etc., all perfectly. It would also be practically impossible to write, slow as frozen beans, and practically impossible to maintain and extend. Again, that’s a “perfect” kernel — perfect is always (or often) theoretically possible, but never actually exists.

    It’s a stupid question, and a worse argument. Fail him.
  • 5
    The question makes no sense. It's a bit like stating "Functional programs using immutable data structures are run in the cloud, true or false."

    One has little to no bearing on the other.
  • 2
    @AlmondSauce @Root @Stop

    So I emailed him as im more confident in my answer now... Here's his reply:

    "The difference is that a non-preemptive kernel is always automatically free from race conditions, while a preemptive kernel preemptive kernel must be designed that way (with mutexes, spinlocks, etc. protecting its data structures).

    It doesn't mean they're not or can't be, they just require extra work. (And the kernels of nearly all modern production operating systems are, in fact preemptive. The exception I know of is OpenBSD.)"

    I still don't get how this makes the original question True... I feel like he just proved me right lmao
  • 2
    additionally, I don't understand his logical fallacy at the end. "And the kernels of nearly all modern production operating systems are, in fact preemptive" -- how does this add any validity? In 2019, google was even able to find race conditions within Linux by running some complex tests.
  • 2
    @energy-vampire That makes absolutely no sense. He's arguing against himself.
  • 0
    A preemptive kernel maybe is, but not all of them.
  • 1
    Update: I emailed the authors of the text we use in class. I sent them the EXACT question from the quiz. They said they would answer agreeably with me, and everyone else in this thread for that matter, that the answer is false. Not true. I'm not sure if it's worth bringing up in class cause it was just 1 point, but i can sleep now. professor will just forever be wrong.
Add Comment