The questions of this series is collection from the Internet.
1. Differences between processes and threads. (No auditing...)
A thread is an execution unit in a process and a schedulable entity in the process.
Differences from processes:
(1) scheduling: A thread is the basic unit of scheduling and allocation, and a process is the basic unit of resource ownership.
(2) concurrency: not only can concurrent execution be performed between processes, but also between multiple threads of the same process.
(3) Owning resources: a process is an independent unit of resources. A thread does not own system resources, but can access resources belonging to a process.
(4) system overhead: when a process is created or withdrawn, because the system allocates and recycles resources for it, the overhead of the system is significantly greater than the overhead when a thread is created or withdrawn.
2. test method (No auditing...)
Manual testing: personal review, spot check, and review
Machine testing: black box testing and white box testing
3. Differences between heap and stack. (No auditing...)
Heap is a stack, and stack is a stack.
Stack space is automatically allocated/released by the operating system, and heap space is manually allocated/released.
Stack space is limited, and heap is a large free storage zone.
The memory allocated by the malloc function in C is on the heap, and the c ++ corresponds to the new operator.
ProgramDuring the compilation phase, the variables and function allocation memory are both carried out on the stack, and parameter transfer is also carried out on the stack when the function is called during the program running.