You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The QueryProviderService resolves a list of IQueryProvider based on the supplied command. Each provider kicks of an task that performs the query and updates the same IList<IQueryResult>. Here's a code snippet
If two threads simultaneous enters this for loop they would both get the same initial value for i, which is a problem in the following scenario:
One of the threads execute the entire code block and removes the element before the second thread tries to access target[i], and an index out of bounds exception will be thrown
The threads execute in parallel but in the remove statement they both access target[i] and one of them is going to succeed and the other one would get an index out of bounds
The reason this is not a problem today is that Jarvis only has three query providers, and none of them are overlapping.
I think it would make sense to execute the query providers in parallel, but edit the list in once all providers have returned their results.
The text was updated successfully, but these errors were encountered:
The
QueryProviderService
resolves a list ofIQueryProvider
based on the supplied command. Each provider kicks of an task that performs the query and updates the sameIList<IQueryResult>
. Here's a code snippetIf two threads simultaneous enters this
for
loop they would both get the same initial value fori
, which is a problem in the following scenario:target[i]
, and an index out of bounds exception will be throwntarget[i]
and one of them is going to succeed and the other one would get an index out of boundsThe reason this is not a problem today is that Jarvis only has three query providers, and none of them are overlapping.
I think it would make sense to execute the query providers in parallel, but edit the list in once all providers have returned their results.
The text was updated successfully, but these errors were encountered: