linux-sysprog · beginner · ~15 min
Tell race-safe operations from racy ones.
Implement int op_is_safe(const char *op) returning 1 for "atomic_fetch_add" or "mutex_guarded" and 0 for "plain_plusplus".
#include <string.h>
int op_is_safe(const char *op) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.