I am new to RenderScript and still have not so good idea on blocking/non-blocking nature of the calls from Java layer. The general question is: which situations block the code and allow RenderScript to finish. Particularly:
- From Java I invoked a kernel using
forEach_kernel()and that was not blocking - I had to add an extraAllocation.copyTo()so that I could use the result. Was there another way? - I read somewhere that if there are 2 kernels then calling second will block until the first one will finish. What conditions result in this - maybe only when working on the same allocation?
- Will the invokable functions block a) each other, b) kernel? Particularly, I have a custom initializer invokable function which I need to prepare some data which will be later used by the kernel. This preparation might take some time so I would like to know if it is dangerous to call in Java
script.invoke_somefunc()and then immediately callscript.forEach_kernel()?