A simple server application capable of handling post
(posting content onto the bullentin board), pull
(getting content from the bullentin board), exit
(client exit). The bullentin board can have at most 5 servers accessing and each server can handle up to 20 clients.
- Using
poll
to enable I/O multiplexing in server.c - Using filelock to prevent race condition
An improvement of the bullentin system above.
- All read and write to client is checked after
poll
. - Emphasize on how to manage state of the client in the event-driven server
Maintain a service tree consists of processes. Manager get user input from stdin
, and act as the orchestrator to pass user's request to its children.
fork
,exec
to create servicepipe
,FIFO
to communicate between services- Note: The
judge.py
is contributed by kenlina
Implement a signal-driven scheduling mechanism to context switch between threads of execution. The thread here is user-level threads, we did not use pthread
library here. Use setjmp
, longjmp
to context switch between user-level threads mimicking a coroutine behavior.
- Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking.