1 / 4

CSCE 510 - Systems Programming

In this lecture, we revisit POSIX threads and their implementation in systems programming. We outline the requirements for a webserver assignment, which includes creating a daemon process, managing incoming TCP connections on a specified port, forking to handle HTTP requests, and generating static and dynamic web content responses. The session covers essential components from TLPI such as socket programming and threading examples to facilitate the development of the web server, alongside important notes regarding deprecated methods like getaddrinfo.

danika
Télécharger la présentation

CSCE 510 - Systems Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCE 510 - Systems Programming Lecture 24 POSIX Threads Again

  2. Overview Last Time • Webserver Assignment • TLPI/sockets/readline • TLPI/sockets/inet.c • TLPI/sockets/gethostbyname • deprecated  getaddrinfo • Email ?? method missing Today • Webserver Assignment handout • POSIX threads from last times slides • Autotools • Top Editors for Linux

  3. webserver email In this programming assignment you will develop a simple webserver. It should: \begin{enumerate} \item Be run as a daemon - up all the time. \item Is it killable with SIGINT ``kill -2 pid?'' \item Create a TCP socket on some port > 5000. \item Accept connection. \item Fork and read HHTP requests \item generate the static page responses \item Handle cgi requests for dynamic web content \end{enumerate}

  4. TLPI/threads Example Programs simple_thread.c(Example 29-1) very simple one thread hello-world detached_attrib.c (29-2) pthread_attr – detached attr thread_incr.c (30-1) thread_incr_mutex.c ( ) thread_cancel.c( ) thread_multijoin.c( ) strerror_tls.c( ) prod_condvar.c( ) thread_cleanup.c( ) strerror_tsd.c( ) strerror_test.c( ) strerror.c( ) prod_no_condvar.c( ) one_time_init.c( )

More Related