---------- Problem 1: ---------- Given the two threads below: void *thread_a(void *arg) { printf("Thread A: before synchronization\n"); printf("Thread A: after synchronization\n"); } void *thread_b(void *arg) { printf("Thread B: before synchronization\n"); printf("Thread B: after synchronization\n"); } write the code for the , so that: "Thread A: after synchronization" is always printed *after* "Thread B: before synchronization", *and* "Thread B: after synchronization" is always printed *after* "Thread A: before synchronization". ---------- Problem 2: ---------- Given N threads, with the following code void *thread(void *arg) { int index = *((int *)arg); printf("Thread %d: before synchronization\n", index); printf("Thread %d: after synchronization\n", index); } write the code for the , so that all "Thread x: before synchronization" are printed before all "Thread x: after synchronization" N is arbitrary.