I have multiple jobs that write to different indexes of a dynamic buffer. Each job knows which index it has to write to and will write to that index on multiple entities. Afterwards a single job works on the entire buffer. A simplified example:
job A : writes "A" to index 0
job B: writes "B" to index 1
job Z: combines all buffer elements
buffer of entity C after jobs A + B ran: ["A", "B"]
buffer of entity D after jobs A + B ran: ["A". "B"]
i can guarantee that no job writes to the same index and non of those jobs add or remove elements. If i pass the buffer in all IJE using the ref keyword the scheduler will only allow a single jobs to access the buffer at a time. For the example above this would mean that job B will not run until Job A completes. I would like to allow A and B to run in parallel and only job Z to wait for the others to complete. Is it possible to do this?
I used a buffer for convenience because i can bake it with the correct length. Using a native array would be an option as well because the length will never change.