Forum Xamarin.iOS

ThreadPool takes almost a minute to dispatch a thread, under certain conditions

SamiraSamira USMember

The problem seems to occur under specific conditions. One such set of conditions includes:

  • iPad mini 4 with iOS 9.2 (problem is not present on iPad mini's) and
  • poor network conditions (can simulate this using the Network Link Conditioner developer tool using very low bandwidth settings)

Under these specific conditions, threads are not dispatched for a very long time - i.e. on the order of minutes.

Different methods I have tried include using QueueUserWorkItem:

ThreadPool.QueueUserWorkItem ( LoadFile );

Or TPL:

Task t = Task.Run( () => this.LoadFile( ) );
t.Wait ( );

With both the above, the time between calling the thread and actually entering the LoadFile method can take on the order of minutes.

Do you know why this can happen and is there a way to ensure faster dispatching?

Tagged:
Sign In or Register to comment.