Lecture 5 Nonblocking I/O and Multiplexing Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.

Slides:



Advertisements
Presentasi serupa
PEMOGRAMAN BERBASIS JARINGAN
Advertisements

UNDERSTANDING NETWORK DESIGN IP ADRESS & SUBNETTING
Pemrograman Jaringan Socket Programming Aurelio Rahmadian.
Komunikasi antar Proses
Function.
Materi 4 : Aljabar Boolean Dosen : Ulil Hamida
Fungsi Lecture 7. Motivation Complexity of programming problem  more difficult to consider the solution as a whole  clue: dividing the problem into.
STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else.
CONCURENCY CONTROL DISTRIBUTED DATABASE. M AIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized.
Pengembang aplikasi memiliki kemampuan untuk memperbaiki beberapa parameter TCP, seperti buffer dan maksimum ukuran segmen maksimum Socket Programming.
Game Theory Purdianta, ST., MT..
GRADE/ SEMESTER : VII/ I
Pertemuan 2 Socket Introduction
Proses Konsep Proses Penjadwalan Proses Operasi pada Proses
Syllabus Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
1 DATA STRUCTURE “ STACK” SHINTA P STMIK MDP APRIL 2011.
BLACK BOX TESTING.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
1 Pertemuan 17 Input / Output Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
REPETITION CONTROL STRUCTURES
Bina Nusantara Model Simulasi Peretemuan 23 (Off Clas) Mata kuliah: K0194-Pemodelan Matematika Terapan Tahun: 2008.
Testing Implementasi Sistem Oleh :Rifiana Arief, SKom, MMSI
1 Diselesaikan Oleh KOMPUTER Langkah-langkah harus tersusun secara LOGIS dan Efisien agar dapat menyelesaikan tugas dengan benar dan efisien. ALGORITMA.
Pertemuan 3 ELEMENTARY TCP SOCKETS
Menulis Kolom  Kolom adalah opini atau artikel. Tidak seperti editorial, kolom memiliki byline.  Kolom Biasanya ditulis reguler. Biasanya mingguan atau.
Masalah Transportasi II (Transportation Problem II)
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
Layer Data Link Pertemuan 13 Matakuliah: H0484/Jaringan Komputer Tahun: 2007.
Verb Tense Tense denotes the time of the action indicated by a verb. The time is not always the same as that indicated by the name of the tense.
Pertemuan 5 I/O Multiplexing
1 HAMPIRAN NUMERIK SOLUSI PERSAMAAN LANJAR Pertemuan 5 Matakuliah: K0342 / Metode Numerik I Tahun: 2006 TIK:Mahasiswa dapat meghitung nilai hampiran numerik.
1 Pertemuan 5 Komunikasi antar Proses / Interprocess Communication (IPC) Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01.
1 Pertemuan 23 Sequence Diagram Matakuliah: M0086/Analisis dan Perancangan Sistem Informasi Tahun: 2005 Versi: 5.
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
1 Pertemuan 13 Algoritma Pergantian Page Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
1 Pertemuan 6 Komunikasi antar Proses (IPC) Lanjutan Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01.
BASH Erick, David © Sekolah Tinggi Teknik Surabaya 1.
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
Network Design (IP Address dan Subnetting). Tujuan Mengenal IP Address, bisa mengidentifikasinya dan bisa menggunakannya dalam membangun jaringan. Bisa.
Rekayasa Trafik, Sukiswo
Chapter 10 – The Design of Feedback Control Systems PID Compensation Networks.
OPERATOR DAN FUNGSI MATEMATIK. Operator  Assignment operator Assignment operator (operator pengerjaan) menggunakan simbol titik dua diikuti oleh tanda.
Keuangan dan Akuntansi Proyek Modul 2: BASIC TOOLS CHRISTIONO UTOMO, Ph.D. Bidang Manajemen Proyek ITS 2011.
Dasar query basis data dengan SQLite
KOMUNIKASI DATA Materi Pertemuan 8.
KOMUNIKASI DATA Materi Pertemuan 9.
Pertemuan 23 Sequence Diagram
Rekayasa Perangkat Lunak Class Diagram
Person 8.
Advanced Socket Programming
Pengujian Hipotesis (I) Pertemuan 11
CLASS DIAGRAM.
Dasar-Dasar Pemrograman
Pertemuan VI MAPPING FUNCTION.
Algorithms and Programming Searching
REAL NUMBERS EKSPONENT NUMBERS.
Desain dan Analisis Algoritma
Modul 1b Pengantar Telekomunikasi
Master data Management
Pertemuan 4 CLASS DIAGRAM.
How to Set Up AT&T on MS Outlook ATT is a multinational company headquartered in Texas. ATT services are used by many people widely across.
Things You Need to Know Before Running on the Beach.
THE INFORMATION ABOUT HEALTH INSURANCE IN AUSTRALIA.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
HughesNet was founded in 1971 and it is headquartered in Germantown, Maryland. It is a provider of satellite-based communications services. Hughesnet.
Do you want to check your Zoho mail incoming or outgoing logs and unable to check, go through with this article and access Zoho mail incoming or outgoing.
 Zoho Mail offers easy options to migrate data from G Suite or Gmail accounts. All s, contacts, and calendar or other important data can be imported.
Website: Website Technologies.
Rank Your Ideas The next step is to rank and compare your three high- potential ideas. Rank each one on the three qualities of feasibility, persuasion,
Wednesday/ September,  There are lots of problems with trade ◦ There may be some ways that some governments can make things better by intervening.
Transcript presentasi:

Lecture 5 Nonblocking I/O and Multiplexing Erick Pranata © Sekolah Tinggi Teknik Surabaya 1

2

» Socket I/O calls may block for several reasons ˃Data Input (if data not available) +Read() +Receive() +ReceiveFrom() ˃Data Output (if no sufficient space) +Write() +Send() +SendTo() ˃Listener (until connection established) +Accept() +AcceptSocket() +AcceptTcpClient() 3 © Sekolah Tinggi Teknik Surabaya

» Problems in connection establishment ˃Long round-trip times ˃High error rate connections ˃Slow (or deceased) server » Blocking method call halts the execution of application » Solution: ˃I/O Status Prechecking ˃Blocking Calls with Timeout ˃Nonblocking Sockets 4 © Sekolah Tinggi Teknik Surabaya

5

» Avoid calls that will block » Precheck I/O Status ˃Will I/O block? 6 © Sekolah Tinggi Teknik Surabaya

7

8

9

10 © Sekolah Tinggi Teknik Surabaya

11 © Sekolah Tinggi Teknik Surabaya

» Poll() method ˃Takes two options: +An integer number of microseconds – May be negative to wait indefinitely – May be zero to be used as prechecking +Mode of operation – SelectRead – SelectWrite – SelectError ˃Returns true for pending operations, ready to be processed 12 © Sekolah Tinggi Teknik Surabaya

13 © Sekolah Tinggi Teknik Surabaya

» Polling is considered very inefficient » Sometimes called busy waiting » Solution: ˃Multiplexing ˃Threads ˃Asynchronous I/O 14 © Sekolah Tinggi Teknik Surabaya

» Some issues ˃Write() and Send() call blocks until last byte is written into buffer ˃Socket connection establishment will block until +Connection established +Connection refused +System-imposed timeout occurs 15 © Sekolah Tinggi Teknik Surabaya

» Example Example 16 © Sekolah Tinggi Teknik Surabaya

» Change behavior of the socket into nonblocking ˃If requested operation can be completed immediately, the calls’ return will succeed ˃ If not, it throws a SocketException with ErrorCode Catch the error, then continue… » Blocking property in Socket class » Also categorized as busy waiting technique 17 © Sekolah Tinggi Teknik Surabaya

» Example Example 18 © Sekolah Tinggi Teknik Surabaya

19

» I/O on multiple channels simultaneously » Example: echo service on several ports ˃Socket binds to a port ˃ At Accept(), which socket to choose? ˃ Accept() or Receive() may block +Use nonblocking sockets? 20 © Sekolah Tinggi Teknik Surabaya

» Socket.Select() method ˃Behavior +Specify a list of sockets to check for pending I/O +Suspends the program until one or more of the sockets in the list becomes ready to perform I/O +The list is modified to only include those Socket instances that are ready ˃Parameters +The first three: list of sockets +The fourth: time in microseconds 21 © Sekolah Tinggi Teknik Surabaya

» Example Example 22 © Sekolah Tinggi Teknik Surabaya

» David Makofske, Michael J. Donahoo, Kenneth L. Calvert, TCP/IP Sockets in C#: Practical Guide for Programmers, Morgan Kaufmann, © Sekolah Tinggi Teknik Surabaya