0 is the threadpool in your example, always.

'worker' means the task will always be executed in a worker thread that is NOT the thread that started the task (usually the task is started in the master thread).

Henry Rich

On 12/22/2022 2:50 PM, Ak O wrote:
On Wed., Dec. 21, 2022, 19:20 bill lam, <bbill....@gmail.com> 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

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to