Tails or Heads #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains two small fixes or improvements:
use
AddTail()
instead ofAddHead()
when queuing I/O requests. For writing, this is essential, because sending always reads the list from the head, so if the queue also inserts to the head, this means outgoing packets could be sent in reverse order. For reading this is less critical, except for example MiamiDx queues up multiple requests for faster I/O, and if both list processing starts from the head, the same I/O request gets reused most of the time, instead of all in the queue.changed yielding to take into account that UNIT_VBLANK has a granularity of 1/50th of a second (20000 microsecond). So essentially both the previous 1000 or 10000 microsecond values just waited until the next, or the next-next VBlank anyway - if no signal was received. Now yielding always just waits until the next VBlank or the next signal. Also, don't wait if there are more packets.
I only tested these changes on my fast Amiga 2000/060 with a very fast DMA SCSI controller. It's possible that they have ill-effects on slower systems, especially the yielding change, as now there's no wait if there are more packets.