peter-lawrey / Java-Thread-Affinity

Control thread affinity for Java
379 stars 77 forks source link

More info on lock status #30

Open PeterIvanov opened 12 years ago

PeterIvanov commented 12 years ago

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:

Thank you.

peter-lawrey commented 12 years ago

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.

PeterIvanov commented 12 years ago

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.

peter-lawrey commented 12 years ago

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