Class Threads

Summary

Package:
threads
File:
thread.icn
Methods:
do_work, house_keeping, map_reduce, master_func, shutdown, submit_async, submit_sync, thread_func

Fields:
actual_work, cv_master, cv_work, done, master, task_active, task_ready, thread_active, thread_ready

Source code.

Details
Constructor

Threads(n)

Methods:

do_work()

 The work that the thread has to do.
 This function can be implemented by the subclass
 or actual_work can be pointed to a procedure that
 does the work


house_keeping()


map_reduce(tsk, r_func, args, n)


master_func()

 The master thread routine.


shutdown()


submit_async(tsk, r_func, args, n)


submit_sync(tsk, r_func, args, n)


thread_func()


Fields:
actual_work -- points to a procedure (work) that the thread are supposed to do.

cv_master

cv_work -- condition variable that all threads on thread_pool wait on when there is no work to do.

done

master -- "the house keeper thread"

task_active -- the list of tasks being processed

task_ready -- the list of tasks waiting to be processed

thread_active -- a list of all ready threads

thread_ready -- a list of all ready threads


This page produced by UniDoc on 2021/04/15 @ 23:59:54.