federicomena,
@federicomena@mstdn.mx avatar

Dear C programmers,

/* The following static variable is declared 'volatile' to avoid a
possible multithread problem in the function get_charset_aliases. If we
are running in a threaded environment, and if two threads initialize
'charset_aliases' simultaneously, both will produce the same value,
and everything will be ok if the two assignments to 'charset_aliases'
are atomic. But I don't know what will happen if the two assignments mix. */

Please. FFS.

pwithnall,
@pwithnall@mastodon.social avatar

@federicomena Wow that dates from another era.

federicomena,
@federicomena@mstdn.mx avatar

@pwithnall 2001-ish? Were atomic writes not a thing then?

ebassi,
@ebassi@mastodon.social avatar

@federicomena @pwithnall atomic compare and exchange was introduced in the '90s, but full atomic ops are from the early '00s, alongside the 64bit migration. AFAICS, GLib got its first atomic ops in 2004

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