Java-Thread-Affinity icon indicating copy to clipboard operation
Java-Thread-Affinity copied to clipboard

More info on lock status

Open PeterIvanov opened this issue 13 years ago • 3 comments

Currenty there is little info about what's going on, apart from logging. That one is useful, but, yet again, we use log4j logging, so java.util.logging doesn't cope well.

Info that is currently logged but not accessible in interface:

  • cpus isolation info (are isolated cpus assignable, or all of them from 1 to N are just assumed to be)
  • binding info - success/failure, thread-to-cpu relation
  • binding status (I fugured out that AffinityLock instance fields may be used to deduce this info, but more direct way would be better)

Thank you.

PeterIvanov avatar Mar 30 '12 15:03 PeterIvanov

It is intended that only isolated cpus are assignable, or the cpus you specify on the command line.

If you have no isolated cpus, it assumed, you will use any available.

It will log whether a thread acquires a cpu or not. You can imply whether its was successful by looking at the cpu id which is negative on a failure.

peter-lawrey avatar Mar 30 '12 22:03 peter-lawrey

Well, yes, it is possible to imply, but I fear that this value may mean something else, say, in future versions. I would prefer to just use some interface method for that purpose.

The same goes with isolation info. For instance, I would prefer not to use LockSupport at all if cpu isolation is not set up in the system for some reason. Currently your lib has this info, but does not provide it directly, so user must either receive it by other means, or imply.

PeterIvanov avatar Apr 02 '12 06:04 PeterIvanov

A method could be added which returns a boolean. I can do that this week.

peter-lawrey avatar Apr 02 '12 19:04 peter-lawrey