CSE451 Section 6: Spring 2006 Web server & preemption.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
CSE 451: Operating Systems Section 6 Project 2b; Midterm Review.
Threads Section 2.2. Introduction to threads A thread (of execution) is a light-weight process –Threads reside within processes. –They share one address.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
3.5 Interprocess Communication
Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Preemptive Scheduling Vivek Pai / Kai Li Princeton University.
CS-3103 & CS-502, Summer 2006 Programming Project #31 Programming Project #3 Web Server CS-3103 & CS-502 Operating Systems.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
CS252: Systems Programming Ninghui Li Final Exam Review.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Characteristics of Communication Systems
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Application Layer Functionality and Protocols.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Remote Procedure Calls Babak Esfandiari. RPC Introduced by Birrell & Nelson (1984) Remote Procedure Calls allow a program to make use of procedures executing.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
Data Streams David Meredith Source Chapter 19 of – Shiffman, D. (2008). Learning Processing. Morgan Kaufmann, Burlington, MA. ISBN:
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
Web Technologies Lecture 1 The Internet and HTTP.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
Prepared by Dr. Jiying Zhao University of Ottawa Canada.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Java Networking I IS Outline  Quiz #3  Network architecture  Protocols  Sockets  Server Sockets  Multi-threaded Servers.
CSE 451: Operating Systems Section 6 Project 2b. Midterm  Scores will be on Catalyst and midterms were handed back on Friday(?) in class  Talk to Ed,
Application Layer Dr. Adil Yousif Lecture 2 CS.
Tiny http client and server
WWW and HTTP King Fahd University of Petroleum & Minerals
Operating Systems CMPSC 473
CS 6560: Operating Systems Design
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Networking COMP
Processes and Threads Processes and their scheduling
Computing with C# and the .NET Framework
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 2: System Structures
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
2017, Fall Pusan National University Ki-Joune Li
HTTP Hypertext Transfer Protocol
JavaScript & jQuery AJAX.
HyperText Transfer Protocol
William Stallings Data and Computer Communications
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ECE 4450:427/527 - Computer Networks Spring 2017
WEB SERVICES From Chapter 19, Distributed Systems
Traditional Internet Applications
HTTP Hypertext Transfer Protocol
CSE 153 Design of Operating Systems Winter 2019
Computer Networks Protocols
Message Passing Systems Version 2
Message Passing Systems
Presentation transcript:

CSE451 Section 6: Spring 2006 Web server & preemption

Overview  Server software architecture  Preemptive scheduling

Server & client  You want to use Google search  What do you do? Open your web browser Load Google web page Type query & use it  Some one provides services  You are the user of those services  Use real world terminologies to call two entities Server & client

Basic client & server model  Real world Client goes to the shop & order services Exchange money & services  Virtual world Client connect to the server & request services  Both client and server are programs What do they exchange?  How about salesman? So does virtual world? Why or why not?

Exchanging data  Simply it is another kind of program  Can a client use all kinds of services?  Can a server serves all kinds of services? Why or why not?  Every program has different input & output format We use a protocol between client and server Client Server request response

Protocol  Specification of input & output Data representation  Input & output & error Meaning(semantic) Functionalities  Set of clients/servers understand protocol ‘Z’ Z client, Z server Z agent, sometimes…  Protocol categorized by data representation Binary – SNMP, X.500, DCE RPC, SSL, Kerberos, IIOP… Text – SMTP, FTP, HTTP, …  XML – SOAP, XML-RPC, …

Issues implementing protocol  Data representation Integer – byte order problem Floating point – representation problem String – character set problem Structured data – structural representation  Behavior Implementers interpret the standards in different ways Client does not behave as server expects Server does not behave as client expects  Just like man & woman…

Writing server program  Choose core service model Fork per connection Process pool Thread per connection Thread pool Thread per request …  Encoding/decoding messages  Design a state machine of one connection  Implement the behaviors

Web server  Is it a precise term? Is there a protocol named ‘Web’?  Then what is the protocol? Hyper Text Transfer Protocol  HTTP server A program understands requests conforming HTTP and is able to process it and generate results conforming HTTP Apache, IIS, Jigsaw, TUX, Zeus, …

HTTP Overview  Request METHOD REQUEST-URI HTTP- Version (HEADERS) Example: GET /index.html HTTP/1.1 Currently, 8 basic methods are defined  Response HTTP-Version Status-Code Reason- Phrase (HEADERS) Example: HTTP/ OK contents…..  HTTP 1.1 standard

One client, one request at a time initialization while ( !terminate ) { wait connection read request from network decode request process request encode response write response to network } finalization

One client, multiple requests at a time initialization while ( !terminate ) { wait connection while ( !noRequest ) { read request from network decode request process request encode response write response to network } } finalization

Multiple client, multiple requests at a time – traditional process based server initialization while ( !terminate ) { wait connection fork if ( isChild ) { while ( !noRequest ) { read request from network decode request process request encode response write response to network } exit } } Finalization

Multiple client, multiple requests at a time – traditional thread based server initialization while ( !terminate ) { wait connection thread_create( while ( !noRequest ) { read request from network decode request process request encode response write response to network } ) } finalization

Multiple client, multiple requests at a time – process pool Initialization Pool := fork N processes while ( !terminate ) { lock accepting socket wait connection unlock accepting socket serve client } finalization

Multiple client, multiple requests at a time – thread pool – per connection Initialization Pool := spawn N threads while ( !terminate ) { wait connection assign worker thread to connection } finalization

Multiple client, multiple requests at a time – thread pool – per request thread_create( while ( !notDead ) { read request from network decode request process request encode response write response to network sleep } ) Working context is assigned by the dispatch thread The dispatch thread also wakes up the worker thread

Preemption  Sick of calling yield? Let the timer do this  Related sources sthread_preempt.[ch]  Useful functions sthread_preemption_init splx atomic_test_and_set atomic_clear

How it works?  Interrupt here is actually called signal Asynchronous integer message Message value = the type of event  Whenever we get a signal Push the PC Jump to the signal handler Execute signal hander Return  Continue from where signal caught

Think about…  What should the interrupt handler (signal handler) do?  Program including your thread package can be interrupted any time, any where Until you disable the interrupt  We provide interrupt en/disable function Which part of your thread package must be protected?  We provide atomic test & set Maybe useful to protect your synchronization primitives