Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified RunnableHandler to process runnables FIFO #193

Closed
wants to merge 1 commit into from

Conversation

sjb933
Copy link

@sjb933 sjb933 commented Jan 3, 2013

Contrary to the expectations of every Handler, I found that the RunnableHandler processes runnables in a LIFO (stack-like fashion).  

The correct approach is to process them in order and then clear the list, as I've done here.  This not only processes the items in FIFO order as expected, it also avoids any overhead of trying to remove the first element of the ArrayList.

Contrary to the expectations of every Handler, I found that the RunnableHandler processes runnables in a LIFO (stack-like fashion).  

The correct approach is to process them in order and then clear the list, as I've done here.  This not only processes the items in FIFO order as expected, it also avoids any overhead of trying to remove the first element of the ArrayList.
@sjb933 sjb933 closed this Jan 3, 2013
@sjb933
Copy link
Author

sjb933 commented Jan 3, 2013

There's a shortcoming with this implementation. This list should be implemented as a LinkedList working as a Queue. Making the changes.

@sjb933
Copy link
Author

sjb933 commented Jan 4, 2013

This fix is actually good, but I've already resubmitted. I was worried about synchronization, but you had already taken care of that. This should be changed as I've indicated: #194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant