-
Notifications
You must be signed in to change notification settings - Fork 105
add answers to exercise 1-4 chapter 6 #24
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
add answers to exercise 1-4 chapter 6 #24
Conversation
|
||
/** | ||
* Implement a custom Observable[Thread] object that emits an event when it detects that a thread was started. | ||
* The implementation is allowed to miss some of the events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the problem statement is not super-precise in the book, but the intention was to detect when any thread whatsoever in that JVM process was started, not just one specific thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to expand on my previous comment a bit:
Note that the problem statement says that you can miss some of the events. This is because JVM does not have a callback API for creation and starting of new threads. It means that you will have to periodically poll to find out which threads that exist in the runtime, and emit events when you observe differences.
Thanks @axel22 |
Thank you for the PR! :) |
Hi @axel22 , |
add answers to exercise 1-4 chapter 6
LGTM - thanks! |
Hi, @axel22
Pls see this answers