Find Jobs
Hire Freelancers

Multi thread operating system in C

$250-750 USD

Cancelado
Publicado hace alrededor de 8 años

$250-750 USD

Pagado a la entrega
you will be developing a network application program that illustrates the client-server computing model. You are asked to write a real, working web server under the Linux operating system. To simplify your work, we have provided you with the C code for a very basic web server. This basic web server uses a single-threaded architecture to perform the required work, where the web server process will receive one user request at a time and serve it before accepting any new requests. Your job in this project is to make the web server more efficient by changing the way it handles the received requests. Your new web server shall use a multi-threaded architecture where the main thread receives new requests and inserts them into a waiting list, and a scheduling thread removes a request from the list and assigns it to a worker thread. The provided basic web server can handle some type of files HTML, GIF, JPEG, TXT, etc. It can also handle a limited portion of the HTTP web protocol (namely, the GET command to fetch a web page). You are not required to change that. The provided pieces of code are designed to help you concentrate on the required changes only. The parts of code that handle the interpretation of the text string(s) received in the request, logging functions, sending back the response string(s) and the requested target are provided to you in a compiled object file, while the parts that require change are provided to you in source files. Objectives: A web server has many of the problems you studied in the operating systems course, but it is easier to understand, modify and test a web server code than modifying and testing the code of a real operating system. In this project you are going to gain hands-on experience in the following areas: • Modifying an existing code base. • Creating and synchronizing cooperating processes and threads in Linux. • Setting up client-server inter-process communication using Internet sockets. • Applying some scheduling and overload handling strategies to improve system performance. • Using a benchmarking tool to measure the system performance. Multi-threaded Design: A better approach is to create a new worker thread for each client to serve his/her request. With this approach, each request can be responded-to, independently and once it is finished, that thread is terminated. If new worker threads could not be created for the incoming HTTP requests, then those requests will need to be buffered until new threads are created. In your implementation, you must have a master thread, a scheduling thread and worker threads. Master Thread: 1. The master thread is responsible for accepting new HTTP connections over the network and placing their descriptors in a fixed-size buffer. It acts as a producer to the buffer. 2. The master thread should not read from any connection, it must immediately return to accepting more connections. 3. If the buffer is full, the master thread must follow the specified overload handling policy. Scheduling Thread: 1. It acts as a consumer from the buffer. 2. The scheduling thread, repeatedly, attempts to create a new worker thread. 3. If it succeeded, then it applies the specified scheduling policy, described below, to select the HTTP request that should be removed from the buffer and sent to the new worker thread. Worker Thread: 1. Each worker thread must be able to handle only static requests. 2. Once a worker thread is activated, it should call the serve() function with the network descriptor it gets from the scheduling thread. 3. The worker thread terminates after it finishes serving the HTTP request. Note that the master thread and the scheduling thread are in a producer-consumer relationship and require that their accesses to the shared buffer be synchronized. Specifically, the master thread may block and wait if the buffer is full; the scheduling thread must block and wait if the buffer is empty. In this project, you are required to use semaphores for synchronization.
ID del proyecto: 10264033

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
1 freelancer está ofertando un promedio de $500 USD por este trabajo
Avatar del usuario
hello sir, I am a Linux Programmer, and I have done a similar project in the before, I have implemented a thread pool to process the multi request in the same time, and I can do your project very quickly because I have many experience with HTTP server programming, HTTP, Pthread programming, Socket programming... etc.
$500 USD en 3 días
5,0 (2 comentarios)
3,3
3,3

Sobre este cliente

Bandera de SAUDI ARABIA
Jeddah, Saudi Arabia
5,0
1
Miembro desde abr 19, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.