Checkpoint: Pool Work Queue
Challenge on lesson: Checkpoint: Pool Work Queue
CHALLENGE
Difficulty: advanced+25 XP
Given: static task_fn pending[8]; static void *pending_arg[8]; static size_t n_pending; (typedef for void (*task_fn)(void *) included). Implement int pool_submit(task_fn fn, void *arg) (append; 0 on success, -1 when full or fn NULL) and size_t pool_execute(void) (run every pending task in FIFO order, empty the queue, return how many ran).
Press Submit to check your solution.
Back to lesson: Checkpoint: Pool Work Queue