Lecture Notes for Client-Server Interfaces
13 February 2001 - Concurrency
- concurrency - what is it
- more than one computation being carried out at the same time
- coordination among the concurrent computations - none is trivial
concurrency (although providing trivial concurrency is non-trivial)
- concepts
- process - the computation
- execution threads - the action
- shared resources - inter-computation; intra-computation; explicitly
shared resources
- real vs virtual concurrency - don't exploit concurrency features;
stick to the standards
- relations among computations - execution relations; sharing relations
- context switching - overhead particularly
- concurrency and networking
- networking is a naturally concurrent environment - lots of hosts
attached
- client concurrency is effortless; server concurrency is not
- concurrency apis
-
fork()
- create an exact (almost) copy of the calling computation
- the
fork()
return value - pid
-
if ((pid = fork())) { /* in parent */ } else { /* in child */ }
- what else - threads; solaris duplicates threads in the child
-
exec()
and friends
- gut and refinish the calling computation - run a new computation
- the friends differ in the arguments passed and how they're passed
- a successful call doesn't return
- io operations
- most io operations are blocking - cuts down on concurrency
- asynchronous io operations - polling operations
- thread safe io operations
- multiplexing operations - virtual concurrency
This page last modified on 13 February 2001.