8
hinst
2y

I wish people took concurrency more seriously
I get the feeling that often people start writing a project while giving 0 f*cks about thread safety, thinking that it is somehow handled "automatically" by the framework
Only to discover later that large amounts of their code are not thread safe and were only working fine in the past because there were fewer requests, so the chance for two requests happening simultaneously was low

Comments
  • 7
    I'd be interested what language we're talking about.

    But yes, the "thinking" part is what many humans struggle to the utmost with.
  • 2
    To be fair: Concurrency is hard. And it is much harder with crappy languages. But writing heisenbug free code requires to take concurrency serious, as you say.
  • 1
    It all boils down to quality culture - or the lack thereof.
  • 1
    There's also the other extreme: When they don't trust the framework/language and try to solve it with some custom implementation.

    I've seen some bizarre workarounds that came down to people doing stuff like client.SendAsync().Result and then blaming dotnet for being bad at threading. Better write our own client from scratch.
  • 0
    I don't give a shit about thread safety. Why should i? Why should i use threads?

    fork() is superior and can't suffer from this kind of problems. Having said that: In 99% of the time, a single thread in a single process is enough.
Add Comment