Some questions about doing the operating system experiment

Source: Internet
Author: User

What does the group identification code and process identification code for the process under Linux mean?

Process Group ID: a process can belong to a process group. You can send a signal to a set of processes.

For the process group ID, in general, a process executes under the shell, which assigns the PID of the process to the process group ID of the process,
A child process derived from this process has the process group ID that the parent process belongs to, unless the parent process sets the owning group ID of the child process to the same as the PID of the child process.


I don't understand what the status value in the Wait function is.

The exit system calls the parameter status with an integer type, and we can use this parameter to pass the state at the end of the process, for example, if the process ends normally or some kind of unexpected end, in general,0 Indicates no unexpected normal end; other values indicate an error occurred and the process was not properly terminated. When we are actually programming, we can use the wait system call to receive the return value of the child process, thus dealing with different situations. We will cover the details of wait in a later space.

what is the value range of the C language rand ?
RAND () has a value range of [0 Rand_max]
Specifically related to the Rand_max size defined under Stdlib.h
Related to compiler implementations

int Randomprio (double from,double to) {//generates a random number between from and to
return 1+ (int) (to) *rand ()/(Rand_max+from));
}
The implementation of this function should be wrong

Some questions about doing the operating system experiment

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.