peter-lawrey/Java-Thread-Affinity

Improve JavaDoc Documentation

Closed this issue · 3 comments

Core functionality is not documented sufficiently. In particular, I could answer the following questions only by looking into the code:

  • What is the exact influence the specified strategies and their order (!) have?
  • What happens if all strategies fail? Will the thread be prevented from running? Will it run anywhere?

I have added to the Javadoc for AffinityLock.acquireLock

* The strategies are evaluated in order to (like a search path) to find the next appropriate thread.  
* If ANY is not the last strategy, a warning is logged and no cpu is assigned (leaving the OS to choose)

I have also updated the wiki.

https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/How-it-works

Thank you, that should help a lot. Just one more thing: I think it is crucial to state wether the strategies are additive (i.e. all have to return true) or just of decreasing priority (i.e. the first one that finds a suitable thread wins). It is not impossible to infer the latter, but why not say it clearly?

Ok. Done.