diff --git a/lectures/L16-slides-The_Readers-Writers_Problem.pdf b/lectures/L16-slides-The_Readers-Writers_Problem.pdf index e62cb7c..22dc5ea 100644 Binary files a/lectures/L16-slides-The_Readers-Writers_Problem.pdf and b/lectures/L16-slides-The_Readers-Writers_Problem.pdf differ diff --git a/lectures/L16-slides.tex b/lectures/L16-slides.tex index dff2a39..364a9e7 100644 --- a/lectures/L16-slides.tex +++ b/lectures/L16-slides.tex @@ -450,7 +450,7 @@ Unlock works just like the regular mutex unlock. - We do not need to specify what kind of luck we are releasing. + We do not need to specify what kind of lock we are releasing. \end{frame} @@ -511,7 +511,7 @@ sem_post( &roomEmpty ); } -void* reader( void* read ) { +void* reader( void* arg ) { pthread_mutex_lock( &mutex ); readers++; if ( readers == 1 ) { @@ -559,7 +559,7 @@ pthread_rwlock_unlock( &rwlock ); } -void* reader( void* read ) { +void* reader( void* arg ) { pthread_rwlock_rdlock( &rwlock ); read_data( arg ); pthread_rwlock_unlock( &rwlock ); diff --git a/lectures/L26-Asynchronous_I_O_with_select_poll.pdf b/lectures/L26-Asynchronous_I_O_with_select_poll.pdf index fb203e4..418bd03 100644 Binary files a/lectures/L26-Asynchronous_I_O_with_select_poll.pdf and b/lectures/L26-Asynchronous_I_O_with_select_poll.pdf differ diff --git a/lectures/L26-slides-Asynchronous_I_O_with_select_poll.pdf b/lectures/L26-slides-Asynchronous_I_O_with_select_poll.pdf index 5fb6a39..35f44a8 100644 Binary files a/lectures/L26-slides-Asynchronous_I_O_with_select_poll.pdf and b/lectures/L26-slides-Asynchronous_I_O_with_select_poll.pdf differ diff --git a/lectures/L26-slides.tex b/lectures/L26-slides.tex index 5fec0d7..b53a428 100644 --- a/lectures/L26-slides.tex +++ b/lectures/L26-slides.tex @@ -229,7 +229,7 @@ The \texttt{readfds} are obviously sockets we are interested in reading from. - \texttt{writefds} are accordingly those we are interested in writing from. + \texttt{writefds} are accordingly those we are interested in writing to. But what about the \texttt{exceptfds} -- this isn't Java, it's not like we're going to get a \texttt{SocketDoesNotFeelLikeDoingWorkRightNowException}. diff --git a/lectures/L26.tex b/lectures/L26.tex index 8e1d085..ea6734c 100644 --- a/lectures/L26.tex +++ b/lectures/L26.tex @@ -69,7 +69,7 @@ \subsection*{Third option: \texttt{select()}} Our wish is granted. The third opt But that last one, \texttt{FD\_ISSET}, is a little different. It's not as if we would forget whether we put a file descriptor in the set. It's really for us to see what happens after \texttt{select()} is called -- we can find out whether a given file descriptor is in a particular set or not. -The \texttt{readfds} are obviously sockets we are interested in reading from and \texttt{writefds} are accordingly those we are interested in writing from. But what about the \texttt{exceptfds} -- this isn't Java, it's not like we're going to get a \texttt{SocketDoesNotFeelLikeDoingWorkRightNowException}. No, this is for sockets that are in an exceptional state, which usually means there is Out-Of-Band (OOB) data on a TCP socket. We didn't cover this earlier in network communication and we will also not be going into this subject now. But you can find out if a socket is in that state if you have a reason. +The \texttt{readfds} are obviously sockets we are interested in reading from and \texttt{writefds} are accordingly those we are interested in writing to. But what about the \texttt{exceptfds} -- this isn't Java, it's not like we're going to get a \texttt{SocketDoesNotFeelLikeDoingWorkRightNowException}. No, this is for sockets that are in an exceptional state, which usually means there is Out-Of-Band (OOB) data on a TCP socket. We didn't cover this earlier in network communication and we will also not be going into this subject now. But you can find out if a socket is in that state if you have a reason. We don't have to use all three of \texttt{readfds}, \texttt{writefds}, and \texttt{exceptfds} in a call to \texttt{select()} if we do not need them all. If we have only read sockets, we put them all in the \texttt{readfds} set and can just give \texttt{NULL} or empty \texttt{fd\_set}s in for the other parameters~\cite{getaddrinfo}.