On Wed., Dec. 21, 2022, 19:20 bill lam, <[email protected]> wrote:
> create thread pool:
> MAXTHREADS_z_=: {: 8 T.''
> echo 'MAXTHREADS: ',": MAXTHREADS
> 3 : 0''
> if. 1<MAXTHREADS do.
> 0&T."0^:(0 < #) 0$~ (1 >. (<:9!:56'cores') <. (<:MAXTHREADS)- 1 T. '')
> echo 'thread pool#0: ', ": n1=. 1 T. ''
> 0&T."0^:(0 < #) 1$~ (1 >. (<:MAXTHREADS)- 1 T. '')
> echo 'thread pool#1: ', ": (1 T. '') - n1
> end.
> )
>
> for cpu intensive tasks
> f1 t.(0;<'worker';1)"0 foo
>
In this form, is it true that:
-'0' signifies the threadpool that the task will execute in.
-'<'worker';1' signifies the task MUST be executed by the designated
threadpool. (whereas '<'worker';0' would allow for task execution in some
other threadpool)
Thank you
Ak
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm