# Sleeping TA problem - open to bidding

Output should be like the one in the PDF file.

Problem is the sleeping ta problem.

A university computer science department has a teaching assistant (TA) that holds office hours where they provide help to undergraduate students with their programming assignments. The TA's office is rather small, and only has room for one desk with a chair and a computer. There are three chairs outside the office where students may sit and wait if the TA is currently helping another student. If there are no available chairs in the waiting area, the student shows up at a later time. When the TA has finished helping a student, she goes outside to the waiting area to see if there are waiting students. If so, she takes the next student and begins to help them. If there are no waiting students, she returns to her chair in he office and takes a nap. If a student shows up and sees the TA sleeping, they sit in her chair and wake her up.

Using POSIX mutex locks and sempahores, design a solution to the sleeping TA problem. A simple solution can use one mutex lock and two semaphores:

- the mutex lock for controlling access to the chairs. (This of course can be simplified by keeping track of the number of waiting students which roughly resembles the number of students sitting in chairs.)

- a semaphore for signalling the sleeping TA that a student has shown up.

- a semaphore for signalling a waiting student that the TA can now help them.

Students and the TA

Using Pthreads, begin by creating N students where each student runs as a separate thread. In addition, the TA will also run as a separate thread. Student threads will alternate between programming for a period of time, and then seeking help from the TA. If the TA is available, they will obtain help or will sit in a hallway while waiting their turn with the TA. If there are no chairs available, the student will resume programming on their own, and seek help at a later time. If a student arrives and notices the TA is sleeping, they must notify the TA using the appropriate semaphore.

If the TA is helping a student, upon finishing they must check if there are waiting students in the hallway. If so, they must help them as well. They will notify a waiting student by using the appropriate semaphore. If there are no waiting students, the TA can take a nap.

Beceriler: C Programlama, C++ Programlama, Linux, Kabuk Betiği, UNIX

Daha fazlasını gör:

İşveren Hakkında:
( 0 değerlendirme ) United States

Proje NO: #14385644

## Bu iş için 11 freelancer ortalamada \$68 teklif veriyor

hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Daha Fazla

in %bids___i_period_sub_35% gün içinde150%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(115 Değerlendirme)
6.8
A2Design

Hi, this looks like something we could help you with. Our team is Russian-Canadian. We specialise in: PHP & PHP frameworks, WordPress & Woocommerce, Opencart, Magento, API development, HTML5, CSS, JavaScript, Bootstra Daha Fazla

in %bids___i_period_sub_35% gün içinde350%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(2 Değerlendirme)
6.2
in %bids___i_period_sub_35% gün içinde55%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(92 Değerlendirme)
6.6
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(12 Değerlendirme)
4.3
kj163

I have extensive experience in C, Linux and the pthreads library. I can do this project very well. Relevant Skills and Experience C, Linux, pthreads Stay tuned, I'm is still working on this proposal.

in %bids___i_period_sub_35% gün içinde55%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(2 Değerlendirme)
3.9
arksong123

I am interested on your project and i can develop it as u want. I have experiences of 7+ years on the various scope of IT business. Please discuss with me about project more detail. Thanks. Relevant Skills and Experie Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(6 Değerlendirme)
3.1
shobhacodeguru

Will provide an optimal code within your budget and time. Deliverable: Complete source code with extensive coding comments Test report README file with instructions to build and execute the program. Relevant Skills an Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(7 Değerlendirme)
3.3
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
2.0
abdulbasitmirza

Hello Hope you are doing great. I am an Electrical Engineer and good at solving and devising Algorithms. Regarding my skill you can visit my profile. It will be my pleasure to work on this project. Awaiting a pos Daha Fazla

in %bids___i_period_sub_35% gün içinde13%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(3 Değerlendirme)
2.1
pacce

It is easy with me. Please contact me Relevant Skills and Experience I'm have 3 years working in embedded linux Proposed Milestones \$15 USD - Full

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
in %bids___i_period_sub_35% gün içinde15%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(0 Değerlendirme)
0.0