Pages

Wednesday, February 5, 2014

Lab 2 Questions 3,4,5

Lab #2

3a. D= 36,000                     =             .12ms
          299,792,458
M= 10mb = 83,886,080b
R= 1G bps = 1,000,000,000 bps
L = M/R + D
L= 83,886,080                     =             .08412 ms
     1 * 10^9 + 0.00012

3b. D = 2                             =              .0000067ms
        299,732,458
M= 83, 886, 080b
R = 10bps
L = 83,886,080    =             8,388,608 ms
    10 + .0000067

4. Pipe function is used for writing as well as reading data. This method of writing and reading can be used by message pipe.  When the pipe is being referred to at the ends you will be using the pipefd which is to return two file descriptions. Pipefd [0] can be used for reading the ending of data. Pipefd [1] can be used as writing the end of a pipe. Pipes are often combined with the fork function because pipes are commonly used to only talk to itself. Pipe combines with forks so that it can communicate from the head process to the child processes. Int pipe is what creates the actual pipe for the program.
Shared memory = passing data between programs. One program will create a memory while others write it and read it.
Some functions are
Shmget () way to identify a thread
Shmat () process gets address ability
Shmdt () detaches shared memory
Shmctl () thread removes a shared memory id
(collaborated with Chessa Flores and Gerson Rivera)
5. Fread() and Fwrite() is used for reading and writing in binary mode. Fread() uses memory that is saved in that space to a single until type of data in which you will be reading under this location. Fwrite copies the number of in the first parameter that locates all the memory. 

1 comment:

Note: Only a member of this blog may post a comment.