Synchronization patterns 
Handout 06 and all examples in /usr/class/cs110/lecture-examples/threads-cpp 
open, read, write, close, stat, lstat
- stat/lstat - get information about a specific file/directory (ex. see here)
opendir (ex how to iterate through directory) 
- open(pathname, permissions, mode), returns an FD.  Permissions/flags: O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL. 
- After calling read, an internal iterator is incremented so next time you call read, you read next data
- write(fd, buffer, bytesToWrite) may not always write bytesToWrite (keep trying in a while loop)
- dup2(curfd, newfd) sets newfd to the curfd 
Basic concepts of layering and naming in computer systems
Like inodes and the different layers of the file system
  • UNIX v6 file system concepts, data structures, and layers 
  • Assignment 1 and 2 
fork, waitpid, all of the other various status macros, execvp, signal, signal handlers, signal blocking and unclocking, kill, process ids, and process groups  
- fork() - returns the processid of forked process to parent, and returns 0 to the child process. 
- waitpid(pid, int *status, flags) - flags are . Status macros interpret status 
Various inter-process concurrency issues
Single code base controlling multiple processes 
pthread_create and pthread_join
ALL OF EXAMPLES IN THE LECTURE-EXAMPLES
/usr/class/cs110/lecture-examples/thread-c!
Race conditions and critical regions
How to identify them?
C++11 thread class
How to instantiate one, how to use join method 
mutex, condition_variable, lock_guard, unique_lock 
  • How the semaphore combines all of these
  • How to use mutexes and semaphores to protect against race conditions, protect against senseless busy waiting, deadlock, and minimize processesor time wasted by a thread unable to do meaningful work 
Client-server model
Discussed in lecture and the reading from the second (online) textbook 
gethostbyname and gethostbyname_r 
Also know the various data structures associated with it 
sock_addr
KNow the family of socket address records 
Socket APIs
socket, bind, connect, listen, accept  
All examples presented in lecture
/usr/class/cs110/lecture-examples/networking 
(popen and pclose)
Structure of HTTP request
Assignment 6 
MapReduce programing model
Assignment 7 
Filesystem Stuff 
Forking in C
Networking
Threading in C++
Other
File descriptors
  • Lightweight (no fuss of data structures or objects), more useful over network connections since all you have are two functions read/write
  • BUT only have those two functions 
Main Idea
asdf
Description
   Login to remove ads X
Feedback | How-To