1, I'm always told that each threads are execution contexts, but what exactly does a thread contain? It seems contain call stack, cpu registers, and actual execution code ?
2, There are also two types of thread - os level thread and user level thread. they are mapped to each other. When it comes to cpu runs thread
, does cpu only run on either of them or only on os level thread?
3, It's a bit confusing to illustrate how cpu run
thread. I mean, from what I know CPU can only run machine code which are 0 and 1. So what does context switching for cpu mean? if each thread contains binaries which are instructions and cpu just run different instructions?