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

100% CPU usage when polling for messages in Session.java #2

Closed
rvantonder opened this issue Jan 4, 2013 · 1 comment
Closed

100% CPU usage when polling for messages in Session.java #2

rvantonder opened this issue Jan 4, 2013 · 1 comment
Milestone

Comments

@rvantonder
Copy link

The busy-wait loop should be avoided in Session.java, which uses a ConcurrentLinkedQueue. Perhaps consider a BlockingQueue and using take() which blocks the thread until messages arrive.

It also performs well in a multi-threaded environment. (See http://www.javacodegeeks.com/2010/09/java-best-practices-queue-battle-and.html)

@ghost
Copy link

ghost commented Jan 4, 2013

Nice catch. Patch applied for the next release.

@ghost ghost self-assigned this Jan 8, 2013
@ghost ghost closed this as completed in 42de983 Feb 7, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant