Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OhNet Threading model
17-06-2017, 07:14 PM
Post: #1
OhNet Threading model
I have been seeing deadlocks in my java (android) app where an AutoMutex is held, during invocation, and this is gumming up remaining threads.

Is there any restrictions on when calls can be made?

Is it expected to issue further queries in an callbackAsyncComplete, or is this not an expected use case?
Find all posts by this user
19-06-2017, 07:57 AM
Post: #2
RE: OhNet Threading model
(17-06-2017 07:14 PM)mksteve Wrote:  I have been seeing deadlocks in my java (android) app where an AutoMutex is held, during invocation, and this is gumming up remaining threads.

Is there any restrictions on when calls can be made?

Is it expected to issue further queries in an callbackAsyncComplete, or is this not an expected use case?

The only issue I can think of is that you need to be very careful invoking actions from an action complete callback. ohNet has a fixed (but client configurable) pool of invocation objects. Once this is exhausted, further action invocation attempts will block until some pending invocations complete. If all invocation threads end up blocked in this way, there is no way for any invocation to complete so we have a deadlock.

Do you know which mutex your code is blocking on? Or, better, where is ohNet code it is blocking? That'd tell us whether you're hitting the scenario above or have found some new bug.
Find all posts by this user
27-06-2017, 07:46 PM
Post: #3
RE: OhNet Threading model
(19-06-2017 07:57 AM)simonc Wrote:  
(17-06-2017 07:14 PM)mksteve Wrote:  I have been seeing deadlocks in my java (android) app where an AutoMutex is held, during invocation, and this is gumming up remaining threads.

Is there any restrictions on when calls can be made?

Is it expected to issue further queries in an callbackAsyncComplete, or is this not an expected use case?

The only issue I can think of is that you need to be very careful invoking actions from an action complete callback. ohNet has a fixed (but client configurable) pool of invocation objects. Once this is exhausted, further action invocation attempts will block until some pending invocations complete. If all invocation threads end up blocked in this way, there is no way for any invocation to complete so we have a deadlock.

Do you know which mutex your code is blocking on? Or, better, where is ohNet code it is blocking? That'd tell us whether you're hitting the scenario above or have found some new bug.

I think you have described my issue - running out of connections and no way to complete - so don't invoke in an action complete.
Find all posts by this user


Forum Jump: