Hi all,
i just started started learning system programming and want to pursue a career in the sys prog area.
below is the program that use a fork() call.
i read in one of the tutorials that parent process and child process uses different address spaces and runs concurrently.
that meas each process gets some slice of cpu time, then the statements in that process are executed.
my Questions:
1.is there any way to know how much timeslice each process is getting.
2.what kind of scheduling its using
3. can i print the out put one page at a time ( should wait for keypress to print next page)
4. any links that provides good system programming info(message queues, pipes,shared memory etc.. )
5. appications that uses sockets
6. fork returns zero to the child process and some +ve value to parent.
how is it able to return two values.
1. No
2. Depends on what scheduler the kernel uses.
3. Yes, but this has nothing to do with system or concurrent programming, but with counting how much output you already produced and waiting after a certain amount.
5. Sendmail, Postfix, Firefox, FTP, SSH, ... pretty much anything using a network.
6. It doesn't. By the time fork() finishes, there are already 2 separate processes. In the parent process it's returning the PID of the child. In the child it returns 0. If it can't spawn a child for any reason, it returns -1 and sets errno.
Who have asked few number of questions , I will explain few things about the fork and its usage.
fork is simply creating a process from some other process. The environment, resource limits, umask, controlling terminal, current working directory, root directory, signal masks and other process resources are also duplicated from the parent in the forked child process.
The reason for returning the two values is that we can easily differentiate the process and do appropriate in particular process.
Also another system call available named vfork().If you use that then the parent and the child will use the same address space.
When we use fork then the wait is also comes into that.It is used to make the parent to wait till the child get terminate.
But when we speak about sockets it is better to use select system call instead of forking new process.Because forking processes continuously will make the efficiency down.
Oflate we are finding a few servers experiencing severe slowness. What would be the commands that I need to try to postmortem the situation? (3 Replies)
Hello to all
I want download a file in osx intel 64 with NASM , I want to use socket syscall
This is part of my code
section .data
command db "GET /test/2.gif HTTP/1.1\r\nHost: 10.1.1.187\r\n\r\n", 0
; url db "http://172.16.207.153/test/2.gif", 0
global main... (1 Reply)
Hi,
I wanna add my own system call to Fedora 18 kernel 3.8.2.
From kernel 3.3 I heard there is a new system to add system calls.
So where i can find a guides ?
I wanna print this text: "Hello world!" in terminal, not dmesg. (4 Replies)
hi!:)
i got a problem....:wall::wall:
i got several disks in my diskarray. I attached new disk to allocate it to the swap space.
The problem is : how to recognise the newly attached disk?
I've one more requirement -:wall:- i want to run dns service on another port number.how can i do... (2 Replies)
Hello Experts,
If a Solaris process is calling some syscall, and right now execution is inside syscall doing only CPU work, for example the inside simplest times syscall,
-> app_func
=> times
<< we are here now, we have entered in the times, but not exited yet
<= times
<- app_func... (9 Replies)
I saw somewhere that describe read() as a primitive. But when I lean signals, it says the read() may be interrupted by a signal.
My Question:
1, What is the diffence between primitive and reentrant?
2, Is read() a primitive or reentrant?
3, Are all system calls primitive or reentrant? (2 Replies)
Hi all,
I am using ptrace to keep track of clone syscalls in a program. However, I found that the traced syscall cant be paired. for example, there are some syscalls that have entry, but without exit showing up in the traced sequences. So, is there anyway to distinguish the entry and exit of a... (0 Replies)
I have a question regarding the recv syscall.
Suppose I have a client/server and the following exchange of message took place:
Client --> Server using multiple send syscalls one after another immediately:
send "Packet1"
send "Packet2"
send "Packet3"
Server receives in the... (2 Replies)