0% found this document useful (0 votes)
7 views3 pages

Assignments 25

The document outlines programming assignments for a course in the summer semester of 2025, categorized into three levels: Basic, Experienced, and Expert. Each level presents various tasks related to synchronization problems, concurrent programming, and simulations, with specific requirements and expected outcomes. Collaboration is encouraged, with guidelines on team sizes and programming language preferences impacting grading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Assignments 25

The document outlines programming assignments for a course in the summer semester of 2025, categorized into three levels: Basic, Experienced, and Expert. Each level presents various tasks related to synchronization problems, concurrent programming, and simulations, with specific requirements and expected outcomes. Collaboration is encouraged, with guidelines on team sizes and programming language preferences impacting grading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignments for the course in the summer semester 2025

Apart from the actual solution to the synchronization problem, please provide some
code that would test whether your presented solution is correct in terms of proper
sychronization, if applicable.

If you don't feel confident in programming, you can team up with another student to
complete the assignment for the Experienced and Expert levels. Teams of three are
also allowed, but the final mark will be reduced by 1 point (-1).

Any programming language/framework/OS is accepted. Use of C/C++ will be welcome


(+0.5), while Python is discouraged (-0.5).

-------------------------------
Level Basic (expected grade 3):
-------------------------------

*** Write a program that solves the readers/writers problem in a manner that
prevents starvation of all agents. Devise your own lock.

*** Write a concurent starvation free LIFO queue with a blocking pop() operation.
Pop requests are handled in FIFO order. The vip_pop() operation cuts in the line.

*** There is a T-intersection that connects a two-way primary road with a one-way
access side road.
Driving through the intersection on the primary road is seamless and takes a
defined period of time.
Cars on the secondary road have to give way unconditionally.
Write a program that simulates the intersection. Cars are threads/processes.

*** Network auction house. Clients connect to the auction hause server and
communicate with dedicated proxies running concurrently.
Clients can issue `readprice' or `bid' commands. Server resolves the timing
disputes.

*** An UDP joke server


The server takes the following parameter
BUFFER_SIZE (INTEGER) number of buffer slots, each capable of storing
exactly one joke.
NUM_COMEDIANS (INTEGER) number of processes/threads coming up with
jokes
SOPHISTICATION (INTEGER) a maximum of a random number of seconds that
it takes for a comedian to come up with a new joke
There are NUM_COMEDIANS processes/threads that come up with new jokes and put
them in a bounded buffer.
One server thread receives UDP request for jokes.
For each of the requests it pops a joke from the buffer and sends it as a
reply to the client.
A joke served once can never be reused.

-------------------------------------
Level Experienced (expected grade 4):
-------------------------------------

*** Write a program that solves the readers/writers problem in a manner that
prevents starvation of all agents. Include a fair non-uniform system of priorities.
*** Bike rental server
(it may be an extension of the bike rental script covered in class)
The bike rental server has a set of bikes at its disposal. Each bike has a
(non-neccesarily unique) colour.
Clients can rent one bike at a time. Then, they use it for some (may it be
random) period of time and then the bike is returned.
Each request can rent either
* whichever available bike
or
* bike of a certain colour
Make sure that no request is starved!
You you feel lucky, try allowing requests of more than one bike at a time.
If an appropriate bike is not available, the requesting client is blocked
waiting.

*** Joke server with multiple comedians, multiple audience members and bounded joke
buffer.

The server takes the following parameter


BUFFER_SIZE (INTEGER) number of buffer slots, each capable of storing
exactly one joke.
NUM_COMEDIANS (INTEGER) number of processes/threads coming up with
jokes
SOPHISTICATION (INTEGER) a maximum of a random number of seconds that
it takes for a comedian to come up with a new joke

Clients connect to the server in one of the modes


* NORMAL = client takes whatever joke that they have not been received
yet
* GREEDY = client wants all jokes as they are produced, a greedy client
might
* FRESHJOKE = clients takes only the most recently produced joke

*** Write a program that simulates an intersection of two-way roads, with the
priority road going straight.
Cars are threads/processes.

*** Online real-time auction house for multiple items. Clients connect to the
auction hause server and communicate with dedicated proxies running concurrently.
Clients can issue `register' and `bid_for_a_lot' command. Server resolves the
timing disputes. Prices are updated real-time. Lots that are not outbid within a
certain amount of time are sold.

-----------------------------------------------------------------------
Level Expert (expected grade 5, more lines of code - use with caution):
-----------------------------------------------------------------------

*** Rock-Paper-Scissors Battle Arena


- a network multiplayer game in two flavours to choose from

* Deathmatch mode
Server awaits connections. When at least 2 online, the game starts.
Players see the real-time list of all players with their statistics.
A global chat is featured.
Player statistics are
NUM_GAMES_PLAYED
WON_GAMES_RATIO ( equals to 0 if NUM_GAMES_PLAYED==0 )
Players challenge other players. When a player challanges another
player, none of them can be challanged by a third player.
Challange is made with specific choice R|P|S which is unknown to the
challanged player,
until they reply to the challange with their choice R|P|S.
Challange completed increments NUM_GAMES_PLAYED and modifies the
winner's WON_GAMES_RATIO acordingly.
If challange is not answered in 3 seconds it is considered lost.

* Last Man Standing mode

The game server is run with the following parameter


NUM_PLAYERS ( INTEGER > 0 )
INITIAL_HP ( INTEGER >0, DEFAULT 5 )
Server awaits connections. When NUM_PLAYERS are connected the game
starts.
Players see the real-time list of all players with their statistics.
A global chat is featured.
Players see the list of all players with their statistics.
Player statistics is
PLAYER_HP ( if 0 player is considered dead )
Players challenge other players. When a player challanges another
player, none of them can be challanged by a third player.
Challange is made with specific choice R|P|S which is unknown to the
challanged player,
until they reply to the challange with their choice R|P|S.
Challange lost decrements the loser's PLAYER_HP.
A succession of 3 wins is considered a Killing Spree and results in +1
to the PLAYER_HP
and a message of praise is sent automatically in the chat.
Deaths are also announced in the chat.
If a challange is not answered in 3 seconds it is considered lost.

You might also like