1. Consider the following function. The semaphores a, b, c, d are all initialized to one.
sem_t a, b, c, d;
void f (sem_t *s1, sem_t *s2, sem_t *s3, sem_t *s4)
{
sem_wait(s1); sem_wait(s2); sem_wait(s3); sem_wait(s4);
Critical section
sem_post(s1); sem_post(s2); sem_post(s3); sem_post(s4);
}
Two threads call the function f concurrently. One of these threads invokes f as f(&c, &b, &a, &d). Write down all possible correct invocations of function f by the other thread.