danderson,
@danderson@hachyderm.io avatar

Yesterday I ended up taking a random walk through "the rust memory model is more what you'd call "guidelines" than actual rules".

Today I took a wrong turn and ended up on the LKML, in which I learned that the kernel has its own unique memory model, but also now contains rust code which follows the rust memory model (whatever that turns out to be), and also it's necessary to be able to exchange data back and forth between memory models.

Some days, I'm just amazed that computers sometimes work.

danderson,
@danderson@hachyderm.io avatar

No diss on anyone involved, to be clear. The kernel has reasons for its own memory model, Rust obviously has some memory model even with edge cases (and in some places delegates to c++20, which I'm assuming is partly a consequence of going through LLVM and inheriting a lot of stuff from C++). People are doing hard and productive work to get all these things nailed down and be confident in how computers work.

It's just... could computers work by themselves every now and then please

swetland,
@swetland@chaos.social avatar

@danderson This is one of my grumbles with modern systems languages... their memory models are often frustratingly at odds with being able to do what you want to do in a kernel environment. Migrating to C++ in Fuchsia's kernel caused a pile of headaches because of this.

danderson,
@danderson@hachyderm.io avatar

@swetland ... Fuschia migrated the kernel to C++? Wha?

Also if you have any writeups of how system language memory models interfere with kernel things, I'd love to read more! I can very much believe it's an environment that gets forgotten about, but I don't have a crisp understanding of what hurts/breaks.

swetland,
@swetland@chaos.social avatar

@danderson Oh yeah that happened while I was still there. I was not a fan, but can't fight progress I suppose. It honestly felt like way more complexity than it was worth for how small the kernel was.

Sadly I don't remember all the various headaches, (been almost a decade) just that we fought with a number of what seemed to me like pointlessly annoying expectations C++ had about things.

danderson,
@danderson@hachyderm.io avatar

@swetland I'm not surprised that C++ in particular has strong feelings about things 😁 Reading the LKMM docs now, hoping they'll provide some insight.

danderson, (edited )
@danderson@hachyderm.io avatar

Stop doing memory models

Writes were not supposed to have colors

Years of debugging yet no real-world use found for free running concurrency

Wanted to run two things at the same time anyway for a laugh? We had a thing for that called several computers

"Yes please do a consume load. Please relax my stores" Statements dreamed up by the utterly deranged

They have played us for absolute fools

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • thenastyranch
  • magazineikmin
  • khanakhh
  • rosin
  • Durango
  • ethstaker
  • Youngstown
  • slotface
  • osvaldo12
  • kavyap
  • tester
  • ngwrru68w68
  • megavids
  • GTA5RPClips
  • InstantRegret
  • tacticalgear
  • cubers
  • everett
  • Leos
  • normalnudes
  • anitta
  • modclub
  • cisconetworking
  • provamag3
  • JUstTest
  • lostlight
  • All magazines