Build C++ Project .

종료 등록 시간: 1년 전 착불
종료 착불

Write a program in C++ to create N threads, each representing a lizard, and two other threads, each representing a cat. Each lizard thread will sleep for some random amount of time and wake up hungry. The hungry lizard thread will attempt to cross the driveway safely, as shown in the pseudo-code below. Crossing the driveway will take some number of seconds. Once on the other side of the driveway, the lizard will eat for some random amount of time in the monkey grass. After eating, the lizard will return home to the sago palm as soon as it safely can and sleep again. Each of the two cat threads will periodically sleep. When awake, they will look at the driveway to check on the lizards. If a cat sees too many lizards, it will play with them, causing the entire program to terminate. The two cat threads will not differ in their behavior, but they will vary in who is awake to check on the lizards and which sleeps.

Use one or more locks and semaphores (do not use monitors) to control access to the driveway (the shared resource). Make sure your implementation follows these rules:

• Do not allow too many lizards to cross the driveway at once.

• Do not use busy waits to control lizards.

• Allow the maximum possible number of lizards to cross simultaneously.

1. You must submit the following files for this project:

a. [login to view URL] (the source code file, UNIDIRECTIONAL set to 0 and WORLDEND to 180)

b. [login to view URL] (only submit this for complete the extra)

c. [login to view URL] (the results from an experiment and the changes in the file)

d. Makefile

e. [login to view URL] for you completed the extra unidirectional option or completed a partial solution of the problem

Remembered:you can't do anything outside this [login to view URL] be complete all [login to view URL] file requirements

All files & requirements in attach section

C 프로그래밍 .NET C# 프로그래밍 소프트웨어 아키텍처 C++ 프로그래밍

프로젝트 ID: #35000237

프로젝트 소개

2 건(제안서) 재택 근무형 프로젝트 서비스 이용 중: 1년 전

이 일자리에 대한 프리랜서 2 명의 평균 입찰가: ₹1025

hemsingh1

Hello, We have been working on excel, vba, macros, finance for more than 9 years. We have more than 8 years of experience doing data based projects. I believe this is something I can for sure :) You may check the pro 기타

₹1050 INR (2일 이내)
(14 리뷰)
4.2
shikh1

I'm pretty good at C/C++ as well as multithreading and algorithms. Let's talk about this more in chat :)

₹1000 INR (7일 이내)
(3 리뷰)
1.3