cinema

已关闭 已发布的 Nov 19, 2004 货到付款
已关闭 货到付款

In this assignment, you will implement a program with Unix semaphores to handle ticket reservations taken by different ticket-selling agents connected to the "Fall-OS" ticketmaster's central computer.

We will present each agent by a separate process whose body will consist of all the ticketing made by that agent. These agent processes will execute in parallel. Two or more agents may be doing the same transactions at around the same time. Obviously, reservations/ticketing to the same seats must be performed in mutual exclusion. If an agent tries to reserve/ticket a seat that has already been taken, then disallow this action and print a "seat taken" message. If a transaction tries to operate on a non-existent seat, print an error message.

To ensure these concurrent operations yield correct results, you are to use Unix semaphores to control access to seats, which are stored in shared variables. The concert hall will have *n* rows labeled A, B, C, … .and each row will have *m* seats numbered 1 to *m*.

To simulate (1) the transmission delay between the ticketmaster's central computer and an agent's computer terminal and (2) the processing of each transaction, the first four lines in the body of each agent will specify the required total execution time (in seconds) for each of the four operations performed at that agent. In your implementation, each specified time is the length of the critical section for the corresponding transaction. You should simulate them through system calls to **sleep(****)**.

The input will be as follows:

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

C/C++ in Unix

C 编程 工程 Linux MySQL PHP 软件构架 软件测试 UNIX

项目ID: #3442456

关于项目

2个方案 远程项目 活跃的Nov 22, 2004

有2名威客正在参与此工作的竞标,均价$17/小时

fastmindvw

See private message.

$17 USD 在2天内
(14条评论)
4.7
codingbits

See private message.

$17 USD 在2天内
(0条评论)
0.0