It gives an exception error in the middle of the program. In Case 1, Kernel can be completed (I see results on console) but Kernel2 is interrupted (I cannot see its results on console) after crash and program ends…
I can give Exception message in detail if needed… Looks like a memory location read fault…
** All procedures are identical in both case 1 and Case2.
You might want to post short, complete, buildable code that reproduces the issue. Trying to debug a program based on extremely rudimentary information by exchanging messages in an online forum, is not a efficient process, nor likely one that leads to a successful conclusion.