Please help this uses C in conjunction with C++ I am not familiar with how to go about these prompts:
"
Use the ps, ps -lx, pstree and ps -aux commands to display the information about process attributes.
Use the top command to display the resource utilization statistics of processes.
Open a terminal and type the top command.
Start a browser and see the effect on the top display.
Compile a C program and observe the same effect.
From the top display, answer the following:
How much memory is free in the system?
Which process is taking more CPU?
Which process has got maximum memory share?
Answer the following questions:
What is the output of pstree (description)?
What is the output of ps -aux (description)?
Execute a CPU bound program
Describe the effect of their CPU share using the top display and comment.
Execute an I/O bound program
Describe the effect of their CPU share using the top display and comment.
"
Please help me explain the answers to these questions. This is not a test or an assignment, its part of an ongoing laboratory but kind of left to learn for myself here.
i mean it wants you to run a program or two, so you can see the numbers from PS change, is all it wants.
do you understand a cpu bound program? Just do something like while(true) compute something... call your own babylonian sqrt or something.. right? Keep it short and simple or just steal code online.
This has nothing to do with C or C++. It is all about observing the processes running on your system by using commands at the terminal.
The first thing you should do is start learning about those commands. An easy way to get somewhere is also to simply run them as indicated. For example, start your linux terminal and when you see % type:
ps -lx
and press Enter. The processes command (ps) will list all running processes and give you information about them. To learn more about the ps command, type:
man ps
or simply Google it.
The part to compile a C program is simply to see it in the process tree. Any program will do. Here's one: