puid user id used to direct tty signals uidt psuid saved effective user id from

Puid user id used to direct tty signals uidt psuid

This preview shows page 27 - 29 out of 102 pages.

p_uid; /* user id, used to direct tty signals */ uid_t p_suid; /* saved (effective) user id from exec */ gid_t p_sgid; /* saved (effective) group id from exec */ short p_pgrp; /* name of process group leader */ short p_pid; /* unique process id */ short p_ppid; /* process id of parent */ u_short p_xstat; /* Exit status for wait */ short p_cpticks; /* ticks of cpu time, used for p_pctcpu */ struct ucred *p_cred; /* Process credentials */ struct rusage *p_ru; /* mbuf holding exit information */ int p_tsize; /* size of text (clicks) */ int p_dsize; /* size of data space (clicks) */ int p_ssize; /* copy of stack size (clicks) */ int p_rssize; /* current resident set size in clicks */ int p_maxrss; /* copy of u.u_limit[MAXRSS] */ int p_swrss; /* resident set size before last swap */ caddr_t p_wchan; /* event process is awaiting */ long p_pctcpu; /* (decayed) %cpu for this process */ struct proc *p_pptr; /* pointer to process structure of parent */ struct proc *p_cptr; /* pointer to youngest living child */ struct proc *p_osptr; /* pointer to older sibling processes */ struct proc *p_ysptr; /* pointer to younger siblings */ struct proc *p_tptr; /* pointer to process structure of tracer */ struct itimerval p_realtimer; struct sess *p_sessp; /* pointer to session info */ struct proc *p_pglnk; /* list of pgrps in same hash bucket */
Image of page 27
short p_idhash; /* hashed based on p_pid for kill+exit+... */ short p_swlocks; /* number of swap vnode locks held */ struct aiodone *p_aio_forw; /* (front)list of completed asynch IO's */ struct aiodone *p_aio_back; /* (rear)list of completed asynch IO's */ int p_aio_count; /* number of pending asynch IO's */ int p_threadcnt; /* ref count of number of threads using proc */ int p_cpuid; /* processor this process is running on */ int p_pam; /* processor affinity mask */ }; UNIX also uses a `user' structure to keep auxiliary information which is only needed when jobs are not `swapped out' (see next chapter). 4.1.6 Interprocess communication One of the benefits of multitasking is that several processes can be made to cooperate in order to achieve their ends. To do this, they must do one of the following. Communicate . Interprocess communication (IPC) involves sending information from one process to another. This can be achieved using a `mailbox' system, a socket (Berkeley) which behaves like a virtual communications network (loopback), or through the use of `pipes'. Pipes are a system construction which enables one process to open another process as if it were a file for writing or reading. Share data. A segment of memory must be available to both processes. (Most memory is locked to a single process). Waiting. Some processes wait for other processes to give a signal before continuing. This is an issue of synchronization. As soon as we open the door to co-operation there is a problem of how to synchronize cooperating processes. For example, suppose two processes modify the same file. If both processes tried to write simultaneously the result would be a nonsensical mixture. We must have a way of synchronizing processes, so that even concurrent processes must stand in line to access shared data serially .
Image of page 28
Image of page 29

You've reached the end of your free preview.

Want to read all 102 pages?

  • One '20

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes