- A Concurrent Affair - https://www.concurrentaffair.org -

Talk about Thread Checker

Good, I didn’t oversleep again. I just talked to Corky about the dynamic thread checker again. Here’s what he suggested:

Corky really stressed that we should avoid generating many false positives. That’s what he disliked about the static tools that exist, like FindBugs [3]. After writing more unit tests for the instrumentation strategy I’ll start with annotating DrJava’s codebase and from there work my way into the Java API if I have to.

I think I may want a more flexible format of annotations, though. It’s a little problematic that I cannot use the same annotation class on a class or method twice. I would just like the following format much better:

@OnlyRunBy(eventThread=true)
@OnlyRunBy(threadName="helper")
...

If I can specify each allowed or disallowed thread one by one, then it’s much easier to modify just one of them, e.g. by somehow making it conditional:

// running by event thread is always safe
@OnlyRunBy(eventThread=true)
// running by "helper" is safe as long as not "live"
@OnlyRunBy(threadName="helper" AWTsafe=true) ...

Maybe I’ll have to rethink my annotation format…

[4] [5]Share [6]