How can I declare in spark a shared object by all the threads that does not block execution by locking the entire array (threads are supposed to access different lines from a 2 dimensional array) ?
For example, I would like to declare a 2 dimensional array. Each thread should write on its corresponding line: Thread.currentThread.getId. By doing this, is the entire 2d array locked by one thread, and therefore other threads must wait to get the lock, or does this approach locks only the corresponding line for each thread ? Is there another way to do this ? Thanks, Wanda