seddonm1 commented on pull request #9523:
URL: https://github.com/apache/arrow/pull/9523#issuecomment-786904688


   > > It appears to me (and I have only just started reading the tokio 
documentation) that these tokio::spawn calls are not yielding to the scheduler 
as that would normally happen via the .await call.
   > 
   > @seddonm1 it is my understanding (and it may be wrong) that calls to 
`await` offer an opportunity to yield to the scheduler but the tokio scheduler 
will attempt to use the current thread execute whatever you are awaiting on and 
if that can proceed tokio will execute it -- it makes no attempt to be fair, it 
is trying to maximize throughput
   > 
   > Putting a call to `tokio::task_yield_now()` sticks the current task at the 
back of the scheduling queue (rather than really "yielding" in the normal 
cooperative multi-threading sense
   
   Yes, this fits with my understanding. I would like to try  to create a test 
for this as I have only observed this whilst running from within another 
`tokio::spawn` task - which will probably impact projects like Ballista more 
than DataFusion.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to