x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
awein extra.txt - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\DownloadCentre\Documents\Note Pad Files\awein extra.txt
Girar
Efecto
Propiedad
Historial
http://allendowney.com/cs357spring2000/notes/notes02.txt ////////////////////////////////////////////////////////////////// http://academic.regis.edu/rblument/cs430/Self_assessment_week12.doc ///////////////////////////////////////////////////////////////////////// http://www.hta-bi.bfh.ch/~frc/opsys1/Exercices/PagAndSeg/Solution.html ////////////////////////////////////////////////////////////////////////////// http://seraphim.csee.usf.edu/cop6611/chpt10/chpt10.html ///////////////////////////////////////////////////////////////////////////////// 1. What is the difference between symmetric and asymmetric multiprocessing? The difference between symmetric and asymmetric multiprocessing: all processors of symmetric multiprocessing are peers; the relationship between processors of asymmetric multiprocessing is a master-slave relationship. More specifically, each CPU in symmetric multiprocessing runs the same copy of the OS, while in asymmetric multiprocessing, they split responsibilities typically, therefore each may have specialized (different) software and roles. 2. What is the difference between a loosely coupled system and a tightly coupled system? Give examples One feature that is commonly characterizing tightly coupled systems is that they share the clock. Therefore multiprocessors are typically tightly coupled but distributed workstations on a network are not. Another difference is that: in a tightly-coupled system, the delay experienced when a message is sent from one computer to another is short, and data rate is high; that is, the number of bits per second that can be transferred is large. In a loosely-coupled system, the opposite is true: the intermachine message delay is large and the data rate is low. For example, two CPU chips on the same printed circuit board and connected by wires etched onto the board are likely to be tightly coupled, whereas two computers connected by a 2400 bit/sec modem over the telephone system are certain to be loosely coupled. 3. What is a context switch, what actions are taken in the kernel, and how much time it usually takes in today's systems? Starting and stopping processes is called a context switch. When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run. Typical speeds range from 1 to 1000 microseconds in today's systems. 4. What are the main types of system calls? Describe their purpose. Process control: end, abort; load, execute; create process, terminate process; get process attributes, set process attributes; wait for time; wait event, signal event; allocate and free memory File management Create file, delete file; open, close; read, write, reposition; get file attributes, set file attributes Device management Request device, release device; read, write, reposition; get device attributes, set device attributes; Logically attach or detach devices Information maintenance Get time or date, set time or date; get system data, set system data; get process, file, or device attributes; set process, file, or device attributes Communications Create, delete communication connection; send, receive messages; transfer status information; Attach or detach remote devices 5. Develop a small program in C (or Java) using system calls (e.g. fork(), waitpid(), exit(), kill(), ..) that does the following: a parent process creates a child process that prints its PID the child creates a grandchild and sleeps 120 seconds the grandchild immediatly exits the parent sleeps for 60 seconds and then kills all the processes #include
#include
#include
#include
main() { int child_id,grandson_id,myID; child_id = fork(); if(child_id == 0) /*child process*/ { myID=getpid(); printf("the child process ID is: %d\n", myID); grandson_id =fork(); if(grandson_id ==0) /*grandchild process*/ { printf("grandchild process \n"); exit(); } sleep(120); } sleep(60); kill(0, SIGKILL); /* Kill all the child process and itself */ } 6. Develop an execution driven simulator (C or Java) for a multiprocessor following these steps: create a process for every processor (# processors is an argument to the program) � in each process start executing a program using the exec() system call (for example a simple program that prints "hello I am processor nr " and the processor number.) � each process exits when done � the parent process should check when the children are done (i.e., the processors finished execution of their programs) and then exit #include
#include
#include
main(int argc, char *argv[]) { int *cid; int num_processors=atoi(argv[1]); /* get # processors from program argument */ cid = (int *) malloc (num_processors * sizeof(int)); /* allocate a dynamic array to store child process ID*/ for( int i=0; i< num_processors; i++) /* create child process pool */ { cid[i]=fork(); if(cid[i]==0) /*child process*/ { exec(�sampleProgram�); exit(); } } /* waiting for all child processes */ for(i=0; i< num_processors; i++) waitpid(cid[i],0,0); printf("all child process exited \n "); free(cid); }
awein extra.txt
Dirección de la página
Dirección del archivo
Anterior
7/104
Siguiente
Descargar
( 5 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.