Questions [general]: Series 1 (collection from Internet)

Source: Internet
Author: User

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.
 

 

 

 

 

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.