96
submitted 2 months ago by Merlu@lemmy.ml to c/asklemmy@lemmy.ml

Needless to say i'm talking about the oversimplified and misleading version of the Schrödinger's cat paradigm, where he is both dead and alive until you watch it.

I don't have a job but i follow theater courses at an academy. And my improvisation is both funny and awful until i show it to others.

you are viewing a single comment's thread
view the rest of the comments
[-] JackbyDev@programming.dev 9 points 2 months ago

In computer programm single threaded programs are pretty predictable (apart from human errors). As soon as you have multi threading that goes out the window. Modern CPUs in most devices you use have what's called a scheduler that schedules when to let different things actually use the CPU so you can actually do multiple things at once. It's a super important concept for what we want to do with devices. But because of that you have no guarantee about when (or if) other threads of your own code will execute. Apart from truly insane edge cases, single threaded programs act pretty deterministically. Multi threaded ones do not. It's very similar to the "it's alive and dead until you check" idea because you just don't know. So much so that there are data types we use called things like Maybe where the result is either a success or a failure and you write code for both.

Also much like the cat in a box thing, programmers don't really view it as magic, it's just sort of a side effect of the uncertainty.

[-] Jimmycrackcrack@lemmy.ml 3 points 2 months ago

Is it actually non-deterministic or just too many variables and too much sensitivity to initial conditions influencing the scheduler's decisions for the programmer to reasonably be able to predict?

[-] MrPoopbutt@lemmy.world 3 points 2 months ago

It is deterministic, it is just determined elsewhere.

If thread 1 is working on a task and needs the output of thread 2, it doesn't know what the output is. Of you move the tasks from thread 2 back into thread 1, then you have eliminated the point of multi threading.

[-] racketlauncher831@lemmy.ml 1 points 2 months ago

Yes. It's chaotic but still deterministic.

load more comments (1 replies)
load more comments (2 replies)
load more comments (3 replies)
this post was submitted on 15 Dec 2024
96 points (97.1% liked)

Asklemmy

45289 readers
1239 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS