Skip to content

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

Merged
merged 6 commits into from
Jan 11, 2016

Conversation

ryblovAV
Copy link
Contributor

Hi, @axel22
Pls see this answers


/**
* 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.
Copy link
Member

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.

Copy link
Member

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.

@ryblovAV
Copy link
Contributor Author

Thanks @axel22
I'll try to fix

@axel22
Copy link
Member

axel22 commented Dec 24, 2015

Thank you for the PR! :)

@ryblovAV
Copy link
Contributor Author

Hi @axel22 ,
pls see my changes

axel22 added a commit that referenced this pull request Jan 11, 2016
add answers to exercise 1-4 chapter 6
@axel22 axel22 merged commit 6ca1c72 into concurrent-programming-in-scala:master Jan 11, 2016
@axel22
Copy link
Member

axel22 commented Jan 11, 2016

LGTM - thanks!

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.

2 participants