subject

For Sleeping Teaching Assistant Project can anyone solve using the format below please. Format:
Main function
intmain(intargc, char *argv[]) {
// Initialize your variables
// Create TA threadsleep(1);
for(i=0;i sleep(1);
// Create students threads
}
for(j=0;j }
}
Semaphore wait() function
voidwait(intsema, intparam)
{
while(sema== 0) {}
if(param== 0)
printf("[SEMAPHORE] TA gets the lock!\n");
else
printf("[SEMAPHORE] Student %d gets the lock!\n",param);
sema--;
}
Semaphore signal() function
void signal(intsema, intparam)
{
if(param== 0)
printf("[SEMAPHORE] TA releases the lock!\n");
else
printf("[SEMAPHORE] Student %d releases the lock!\n",param);
sema++;
}
Thread sleepingta() function
void *sleepingta(void *param) {
// Wait & get the lock
printf("[TA THREAD] TA is in the office.\n");
// Release the lock
while(ENDOFPROGRAM) {
// Add your logic
}
// End thread
}
Thread student() function
void *student(void *param) {
// Wait & get the lockprintf("[STUDENT THREAD] Student %d is coming!\n",*(int*)param);
// Add your logic
// Release the lock
// End thread
}
Variables
#include
#include
#define SLEEP 0
#define WAKEUP 1
Int semaphore;
Int MAX, TA, TTL;
Int ENDOFPROGRAM;
Int curstudent;
Int waitinglist;

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 01:40
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
You know the right answer?
For Sleeping Teaching Assistant Project can anyone solve using the format below please. Format:
Questions
question
Mathematics, 08.04.2021 22:20
question
Mathematics, 08.04.2021 22:20
Questions on the website: 13722361