You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void map(size_t pool_size, int (*func)(char *), char **paths, size_t npaths);
that will create and maintain thread pool and distribute the work to thread pool and will wait for completion of all jobs
the idea is that npaths can be strictly bigger than pool_size
the work is calling the function (given by the pointer to function 'func') on given path
test case: each thread will count the number of characters in the file
hint: each worker thread will loop until it cannot get an item from the queue
obviously, the queue access needs to be synchronized
overall progress (percentage computed from total number of files vs. number of files processed)
will be reported to stdout by the main thread (use '\r' to overwrite)
variant: each worker will return whether or not it completed the processing of the item
make the workers randomly return error (i.e. do not complete the processing) in which case the job will be submitted again
The text was updated successfully, but these errors were encountered:
Implement a function:
void map(size_t pool_size, int (*func)(char *), char **paths, size_t npaths);
that will create and maintain thread pool and distribute the work to thread pool and will wait for completion of all jobs
npaths
can be strictly bigger thanpool_size
hint: each worker thread will loop until it cannot get an item from the queue
overall progress (percentage computed from total number of files vs. number of files processed)
will be reported to stdout by the main thread (use '\r' to overwrite)
variant: each worker will return whether or not it completed the processing of the item
make the workers randomly return error (i.e. do not complete the processing) in which case the job will be submitted again
The text was updated successfully, but these errors were encountered: