Presentation is loading. Please wait.

Presentation is loading. Please wait.

Concurrency Wrap-Up & Final Review

Similar presentations


Presentation on theme: "Concurrency Wrap-Up & Final Review"— Presentation transcript:

1 Concurrency Wrap-Up & Final Review
CSE 333 – Section 10 Concurrency Wrap-Up & Final Review

2 Concurrency Wrapup: fork() example
Primary use patterns of fork(): Server handling connections (lecture example) Shell executing programs (this example) Demo: hpsh.c Some cool bash tricks to try out: ps ps; sleep 5 (ps; sleep 5) I’ve just forked in bash as you can tell, I’ve actually used this functionality before. It’s pretty useful! (sleep 0.1; (ps; sleep 1)) Now I’ve forked two. Haha, cool right? sh ps -fx: I’m in a shell that’s inside a bash shell. If I exit, I’m back to where I was. Now then, we talked about fork and exec, well I’ve just shown two examples of how we can fork in bash. Right now I’m inside the sh shell which is inside the bash shell. Let’s type ps. Note my PID. Now I’ll type exec ps. The sh address space was completely taken over by ps. Ps. Now what happens if I type (exec ps)? Inside the forked bash shell ps is executed and takes over it, printing out what you see. And, as you can tell it didn’t replace the shell I’m in right now because it’s still the same PID.

3 The Rest of C++ Templates – template definitions vs instantiation
STL, containers and iterators. vector, list, map Smart pointers, using with STL. unique_ptr (cannot be copied, but can move ownership to another) shared_ptr (reference counting) weak_ptr (using to break cycles and why this is needed) Subclasses, inheritance, virtual functions, dynamic vs static dispatch (function calls), vtables, constructors and destructors in subclasses Pure virtual functions and abstract classes (what they are) Using class hierarchies with STL and smart pointers, assignment slicing, value vs pointer semantics C++ casts Any questions?

4 Network Programming Basic network layers: physical, data link, IP, TCP, application Packets, and packet encapsulation across layers IP addresses, address families (IPv4, IPv6), DNS, ports Stream sockets, file descriptors, read, write Client steps: address resolution, create socket, connect socket to server, read/write (including retries), close Server steps: determine address and port, create socket, bind socket to address/port, listen (and how the OS queues pending connections), accept connection, read/write, close Very basic HTTP and HTML Any questions?

5 Concurrency Multiple processes and fork() (mostly CSE351 review), shared file descriptors and close() in forked processes Threads - concurrent execution inside a single process; know a few of the pthread basics (i.e., what it means to create a thread and start execution in a function) Use of concurrency to improve throughput and resource utilization Any questions?

6 The Pre-Midterm Topics
Don’t forget the first half of the class, the final is cumulative! Brief summary: C programming, pointers and memory management POSIX libraries read, write, open, close, etc. The beginning of C++ classes/modularity, references, operator overloading, and other differences from C Any questions?


Download ppt "Concurrency Wrap-Up & Final Review"

Similar presentations


Ads by Google