Server Programming in C - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Server Programming in C

Description:

Thread per Request (active connection) Leader/Follower. Half Sync/Half Async. Active Objects. Reactor (level triggered) Proactor (edge triggered) ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 10
Provided by: wesle82
Category:

less

Transcript and Presenter's Notes

Title: Server Programming in C


1
Server Programming in C
  • Wesley Bao, November 2005

2
Agenda
  • The myth and reality of design
  • Purpose and overview of the slides
  • Architectural perspectives
  • Implementation perspectives
  • Its decision time
  • Analysis of real-world implementations
  • Q A

3
The Myth of Design
  • Rumor had it that you can follow some design
    process/methodology and come out with a great
    design from scratch
  • Rumor had it that you can explore and prototype
    alternatives, learn from failures and then choose
    the most suitable architecture/design
  • That is the case in research labs and (to some
    extent) OSS world

4
The Reality of Design
  • In reality, you seldom program to a brand new
    domain you seldom have the luxury to explore
    alternatives prototypes can prove something
    wrong but cannot prove something right.
  • Thats why they hire experienced engineers who
    had already familiarized with the domain and
    explored alternatives elsewhere before to
    architect and design solutions people are not
    very much willing to pay for trial-and-error
  • Patterns are a good way to document and pass on
    experience (due diligence)

5
Purpose and Overview
  • Server programming domain knowledge in a nutshell
  • Explore architecture, design and implementation
    alternatives, demonstrate their pros and cons
    backed by real data
  • Analyze a few real-world examples to see why they
    choose certain alternatives

6
Architectural Perspectives
  • Iterative
  • Kernel thread (process) per Connection
  • User space thread (fiber) per Connection
  • Thread per Request (active connection)
  • Leader/Follower
  • Half Sync/Half Async
  • Active Objects
  • Reactor (level triggered)
  • Proactor (edge triggered)
  • How to manage session state
  • Clustered servers load balancing routing server

7
Implementation Perspectives
  • blocking I/O in threads
  • select, poll, dev/poll
  • epoll, rt signal, aio
  • kqueue
  • IOCP
  • Build server into the kernel
  • A survey of platform capabilities
  • Resource Pooling

8
Its Decision Time
  • Short vs. long-duration sessions
  • Fixed packet length or you have to find the
    boundary
  • How long will the idle time likely be
  • Request/Response characteristics
  • Protocol Examples
  • Target user SMB? Enterprise? xSP?
  • Target platforms cross-platform? Dedicated to
    few platforms? Appliance?
  • Use wrappers to build in flexibility? How
    flexible can it be?

9
Real-world Implementations
  • Frameworks (aka half-cooked applications)
  • ACE
  • Indy
  • Infrastructures
  • JVM on various platforms
  • Server-side applications
  • QTSS
  • others
Write a Comment
User Comments (0)
About PowerShow.com