In the Linux environment, use C/C++/Java (or other languages) programming to complete the following experiments: 1) Refer
Question:
In the Linux environment, use C/C++/Java (or other languages) programming to complete the following experiments:
1) Refer to the Linux kernel source code structure, read the Linux kernel source code, analyze the composition of the Linux process, and observe the process management data structure such as task_struc of the Linxu process;
2) Design the business processing logic of the parent process and the child process by referring to relevant sample programs, consulting Linux system calls and other related materials; using advanced programming languages such as C++ and fork(), clone, exec() , wait ( ) , exit ( ) , kill () , getpid() and other system calls, create management processes, observe the structure and concurrent behavior of parent and child processes / threads, and master process control methods such as waiting and canceling.
Require:
( A ) at least 6 system calls such as fork() , clone , exec , wait , exit , kill , getpid are used;
( B ) The created parent and child processes each have different business processing logic. After the parent process creates the child process, the child process calls itself to execute the code through exec() ;
( C ) The process can be terminated actively by itself through exit() , or it can be terminated by the parent process executing the kill() command;
( D ) Observe and compare the differences between subtasks / processes / threads created by fork() and clone() , and analyze the parameters created by setting or not setting CLONE_FS , CLONE_VFORK , CLONE_FILES , CLONE_FS , CLONE_PID and other parameters in the clone() system call Impact of child processes / threads;
( E ) Add random delays at different positions in the created parent-child process / thread code, so that the process execution spans multiple time slices, such as by adding tens to hundreds of milliseconds of delay, to ensure that the process execution time is not less than 3 time slice
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill