1. What is the difference between a thread and a process?
Multi-threaded coexistence in applicationsProgramIs the basic features and Important Symbol. Used UNIX The operating system reader knows the process, in UNIX In the operating system, each application is executed in the operating system kernel.
To register a process flag. Scheduling and system resource allocation for application execution, but what is the difference between processes and threads?
Processes and threads are the basic units for running programs that the operating system understands. The system uses this basic unit to realize the system's concurrency for applications.
The difference between a process and a thread is:
The thread division scale is smaller than the process, making the multi-thread program highly concurrent.
In addition, the process has independent memory units during execution, and multiple threads share the memory, which greatly improves the program running efficiency.
The execution process of a thread is different from that of a process. Each Independent thread has a program running entry, sequence execution sequence, and program exit. But the thread cannot be executed independently. It must exist in the application and the application provides multiple thread execution control.
Logically, multithreading means that multiple execution parts in an application can be executed simultaneously. However, the operating system does not view multiple threads as multiple independent applications to implement process scheduling, management, and resource allocation. This is an important difference between processes and threads.
Into Cheng :( Process ) Is initially defined in UNIX Multi-user, multi-task operating system environment is used to represent the concept of basic execution units of applications in the memory environment. To UNIX For example, the process is UNIX The basic components in the operating system environment are the basic units for system resource allocation. UNIX Almost all user management and resource allocation tasks completed in the operating system are implemented through the Operating System Sequential process control.
C , C ++ , Java After the source program compiled in other languages is compiled into executable files by the corresponding compiler, it is submitted to the computer processor for running. At this time, An application in an executable state is called a process. From the user's perspective, a process is an execution process of an application. From the core perspective of the operating system, processes represent the memory allocated by the operating system, CPU The basic unit of time slice and other resources is the runtime environment provided for running programs. The difference between a process and an application is that an application is stored as a static file in a hard disk or other storage space of a computer system. A process is a system resource management entity maintained by the operating system under dynamic conditions. The main features of application processes in a multitasking environment include:
● The process has an initial entry point for memory units during execution, and it always has an independent memory address space during the process of survival;
● The lifetime status of a process includes creation, readiness, running, blocking, and death;
● From the execution process of an application process CPU The running commands are in different forms. The process status can be divided into user and core states. In the user State, processes execute application commands, and in the core State, application processes execute operating system commands.
In UNIX The system automatically creates Swapper , Init System Processes for managing memory resources and scheduling user processes. In UNIX The process created by the operating system and executed by the application in the environment has a unique process identifier ( PID ).
2. Windows Service ? Its lifecycle and standard EXE What is the difference between programs? ?
Winndows Service Is Windows A program started when the operating system is started and runs in the background. It usually does not interact with users. It cannot be run by double-clicking, similar UNIX Daemon ( Daemon Processes ), It will not stop when the user logs out.
Windows The Service consists of three parts: 1. A service executable file; 2. A Service Control Program (SCP) ; 3. Service Control Manager (SCM) , Responsible HKLM "system" CurrentControlSet "Services Create a service key value. You can SCP Control the startup, stop, and suspension of services, SCP Will pass SCM Call the service program.
WindowStandardEXEAn executable program usually has a user interface,ConsoleOrGui, Usually started or stopped by the user.
3. Windows What is the maximum amount of memory that a single process can access?
Windows A virtual addressing system is used. The system maps the available memory addresses of the program to the actual addresses in the hardware memory. Windows Backend management. Result: 32 Each process on a bit processor can use 4 GB Memory ------ No matter how much hard disk space on the computer ( 64 This value is greater on a bit processor ). This 4 GB Memory actually Contains all parts of the program ------ Including executableCode, All code loaded DLL And programs
The content of all variables used during running. This 4 GB Memory is called virtual address space or virtual Memory.
4. exe And DLL Between them?
The current Windows Medium, EXE And DLL All are based on PE Format, EXE Is a common executable file that contains data and code, while DLL It is a dynamic link file, or it may be a pure resource file that only contains data, excluding program code. DDL One of the purposes is to provide functions and resources that can be used by many different applications. DLL Functions and resources in the service provide reuse for software development. They are executed at runtime by the disk physical image loaded into the memory space or shared memory space of the caller.
5.What is a strong type and what is a weak type? Which one is better? Why??
A weak language allows multiple types of memory. For example, you can directly add integer and character variables.C and C ++It is a static language and also a weak language;Perl and PHPIt is a dynamic language, but also a weak language.
Before forced type conversion, two variables of different types cannot operate on each other.Java,C #AndPythonAnd so on.
The language you want to use depends on your needs. Writing simple small applications and using a weak type language can save a lot of code and improve development efficiency. For large projects, using strong languages may be more standardized and reliable than using weak types.
6. PIDWhat is it? How to use the system in troubleshooting?
PID = process identifier,Is a globally unique integer used to identify a process. In a multitasking system, it can be used to diagnose errors in the system.
7.SingleTCP/IPHow many processes can be listened on the port?
There may be only one. If you need to create anotherTCP/IPListen, you must create another different port
8.What isGAC? What problems does it solve??
Every CLR (Common Language Runtime) Each computer has a global assembly cache. (Global Assembly Cache, GAC) . Deployed on GAC The Assembly on must have a strong name. A . NET Framework SDK Provided "Global Assembly Cache tool" (gacutil.exe) You can deploy the Assembly GAC . GAC Stores the specified assembly for sharing among multiple applications on the computer. It also provides us with a solution "DLL Hell " .
If the name is relatively strong For more information, see strong name assembly. De Build and reference Http://www.cnblogs.com/Dlonghow/archive/2008/08/08/1263935.html