Pertemuan 5 I/O Multiplexing Matakuliah : H0483 / Network Programming Tahun : 2005 Versi : 1.0 Pertemuan 5 I/O Multiplexing
Menghasilkan program dengan menggunakan fungsi-fungsi I/O Multiplexing Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Menghasilkan program dengan menggunakan fungsi-fungsi I/O Multiplexing
Select function Poll function I/O Model Outline Materi Blocking I/O Model NonBlocking I/O Model I/O Multiplexing Model Signal driven I/O Model Asynchronous I/O Model
Blocking I/O Non Blocking I/O I/O Multiplexing Signal Driven I/O Model Blocking I/O Non Blocking I/O I/O Multiplexing Signal Driven Asynchronous I/O
Blocking I/O Model
Non Blocking I/O Model
Multiplexing I/O Model
Signal Driven
Asynchronous I/O Model
Operasi I/O asinkron tdk menyebabkan proses di blok TCP Echo Server Operasi I/O sinkron menyebabkan proses diblok sampai operasi I/O komplit. Operasi I/O asinkron tdk menyebabkan proses di blok Blocking, non blocking, I/O multiplexing dan signal driven I/O adalah termasuk operasi I/O sinkron.
Select () The select() system call allows us to use blocking I/O on a set of descriptors (file, socket, …). For example, we can ask select to notify us when data is available for reading on either STDIN or a TCP socket.
Contoh select () int select( int maxfd, fd_set *readset, fd_set *writeset, fd_set *excepset, const struct timeval *timeout); maxfd: highest number assigned to a descriptor. readset: set of descriptors we want to read from. writeset: set of descriptors we want to write to. excepset: set of descriptors to watch for exceptions. timeout: maximum time select should wait