commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [lang] Thread safety annotations
Date Sun, 27 Nov 2016 23:41:37 GMT
On 27 November 2016 at 22:31, Gary Gregory <garydgregory@gmail.com> wrote:
> On Sun, Nov 27, 2016 at 2:14 PM, sebb <sebbaz@gmail.com> wrote:
>
>> On 27 November 2016 at 22:03, Gary Gregory <garydgregory@gmail.com> wrote:
>> > These annotations are the SAME as have been published all over the place,
>> > so I do not think we need a PR for review. Reviewing the code in the repo
>> > should be enough, but I'm not sure _what_ there is to review really. I've
>> > already posted a link to the sources (a pastebin link). I'll create a
>> Jira
>> > of course.
>>
>> There is one aspect that needs review: does the annotation belong in LANG?
>> If we want to use the annotation in other components, do they have to
>> depend on LANG?
>>
>
> No see below and previous messages.
>
>
>> If not, do they all have their own copies?
>>
>
> No.
>
>
>>
>> And what happens when LANG needs a non-BC release?
>>
>
> What is the issue I am missing?
>

The package name for the annotation might need to change
That would be a downstream nuisance.

>>
>> My expectation for such annotations is that they would be
>> self-contained (or built-in to the languange, not LANG).
>>
>
> It is _because_ they are NOT built-in the language or JRE that we are
> proposing they belong in [lang].
>
> Since we are providing the annotation with CLASS retention only
> (initially), there is no hard dependency on [lang] at runtime.
>
> Is there some subtlety we are missing?

Yes, the compile-time dependency.

AFAIK it's not possible to have a Maven compile-only dependency;
compile-time implies run-time.

> Gary
>
>
>> > Gary
>> >
>> > On Sun, Nov 27, 2016 at 1:20 PM, Benedikt Ritter <britter@apache.org>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> Gary Gregory <garydgregory@gmail.com> schrieb am So., 27. Nov. 2016
um
>> >> 21:01 Uhr:
>> >>
>> >> > So let's start with the CLASS retention annotations first. I'll commit
>> >> > later today.
>> >> >
>> >>
>> >> Maybe create a GitHub PR so people can have a look before it goes to
>> >> master?
>> >>
>> >> Benedikt
>> >>
>> >>
>> >> >
>> >> > Gary
>> >> >
>> >> > On Nov 27, 2016 9:50 AM, "Matt Sicker" <boards@gmail.com> wrote:
>> >> >
>> >> > > I feel like documenting thread safety in such a low level, widely
>> used
>> >> > > library like [lang] is a great idea. Whether it uses annotations,
>> >> > javadocs,
>> >> > > or some sort of informal javadoc comments isn't too big a deal
to
>> me,
>> >> but
>> >> > > providing some guarantees of thread safety or lack thereof would
be
>> >> > > invaluable information.
>> >> > >
>> >> > > On 27 November 2016 at 07:11, Benedikt Ritter <britter@apache.org>
>> >> > wrote:
>> >> > >
>> >> > > > I thought we decided to abstain from documenting thread safety
>> since
>> >> it
>> >> > > > would get outdated quickly anyway.
>> >> > > >
>> >> > > > Gary Gregory <garydgregory@gmail.com> schrieb am So.,
27. Nov.
>> 2016
>> >> um
>> >> > > > 09:11 Uhr:
>> >> > > >
>> >> > > > > But if we then want a runtime version we had an odd
packaging
>> with
>> >> > > CLASS
>> >> > > > > retention in .concurrent. and RUNTIME in .concurrent.runtime.
>> >> > > > >
>> >> > > > > I might be in YAGNI territory here...
>> >> > > > >
>> >> > > > > Gary
>> >> > > > >
>> >> > > > > On Sat, Nov 26, 2016 at 10:07 PM, Matt Sicker <boards@gmail.com
>> >
>> >> > > wrote:
>> >> > > > >
>> >> > > > > > I think adding the additional clazz/runtime package
would be a
>> >> > little
>> >> > > > > > overkill if you only include one packaging option
for now.
>> >> > > > > >
>> >> > > > > > On 27 November 2016 at 00:04, Gary Gregory <
>> >> garydgregory@gmail.com
>> >> > >
>> >> > > > > wrote:
>> >> > > > > >
>> >> > > > > > > On Nov 26, 2016 8:40 PM, "Matt Sicker" <boards@gmail.com>
>> >> wrote:
>> >> > > > > > > >
>> >> > > > > > > > I can think of a couple use cases for
runtime retention
>> for
>> >> > > thread
>> >> > > > > > safety
>> >> > > > > > > > annotations, but they're not specific
to commons lang.
>> >> > > > > > > >
>> >> > > > > > > > 1. A framework could choose what type
of data structure or
>> >> > > > algorithm
>> >> > > > > to
>> >> > > > > > > use
>> >> > > > > > > > at runtime based on the presence of which
thread safety
>> >> > > annotation
>> >> > > > is
>> >> > > > > > on.
>> >> > > > > > > > Same for mutability.
>> >> > > > > > > > 2. A testing framework could use these
annotations to try
>> and
>> >> > > > > automate
>> >> > > > > > > some
>> >> > > > > > > > sort of thread safety tests, though that
sounds like a
>> hard
>> >> > > problem
>> >> > > > > to
>> >> > > > > > > > actually implement.
>> >> > > > > > > >
>> >> > > > > > > > However, it'd be easier to just start
with class retention
>> >> (or
>> >> > > > source
>> >> > > > > > > > retention) just for documentation purposes.
Higher
>> retention
>> >> > > levels
>> >> > > > > > could
>> >> > > > > > > > be added later if an important use case
came up.
>> >> > > > > > >
>> >> > > > > > > But which packaging option?
>> >> > > > > > >
>> >> > > > > > > Gary
>> >> > > > > > > >
>> >> > > > > > > > On 26 November 2016 at 19:56, Gary Gregory
<
>> >> > > garydgregory@gmail.com
>> >> > > > >
>> >> > > > > > > wrote:
>> >> > > > > > > >
>> >> > > > > > > > > On Sat, Nov 26, 2016 at 3:54 PM,
sebb <sebbaz@gmail.com
>> >
>> >> > > wrote:
>> >> > > > > > > > >
>> >> > > > > > > > > > On 26 November 2016 at 19:25,
Gary Gregory <
>> >> > > > > garydgregory@gmail.com
>> >> > > > > > >
>> >> > > > > > > > > wrote:
>> >> > > > > > > > > > > On a [crypto] thread,
I mentioned
>> >> > > > http://pastebin.com/RKPGGdJ9
>> >> > > > > > to
>> >> > > > > > > add
>> >> > > > > > > > > > the
>> >> > > > > > > > > > > "classic" four javax.annotation.concurrent
>> annotations
>> >> to
>> >> > > two
>> >> > > > > > > packages
>> >> > > > > > > > > > > (.clazz and .runtime)
in Commons Lang for CLASS and
>> >> > RUNTIME
>> >> > > > > > > retentions.
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > You'd use the CLASS version
to avoid a hard
>> dependency
>> >> on
>> >> > > > > [lang].
>> >> > > > > > > > > RUNTIME
>> >> > > > > > > > > > > to keep them around.
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > We'd use the CLASS versions
in all of Commons for
>> >> > > documenting
>> >> > > > > > > thread
>> >> > > > > > > > > > safety.
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > Thoughts?
>> >> > > > > > > > > >
>> >> > > > > > > > > > Definitely Class retention,
not Runtime.
>> >> > > > > > > > > > You don't want to have to include
the annotation jar
>> on
>> >> the
>> >> > > > > runtime
>> >> > > > > > > > > > classpath.
>> >> > > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > > Hi Sebb,
>> >> > > > > > > > >
>> >> > > > > > > > > Right now I have both of these packages:
>> >> > > > > > > > >
>> >> > > > > > > > > - org.apache.commons.lang3.annotation.concurrent.clazz
>> >> > > > > > > > > - org.apache.commons.lang3.
>> annotation.concurrent.runtime
>> >> > > > > > > > >
>> >> > > > > > > > > Each with a copy of:
>> >> > > > > > > > >
>> >> > > > > > > > > GuardedBy
>> >> > > > > > > > > Immutable
>> >> > > > > > > > > NotThreadSafe
>> >> > > > > > > > > ThreadSafe
>> >> > > > > > > > >
>> >> > > > > > > > > Should we include what I have as
is?
>> >> > > > > > > > >
>> >> > > > > > > > > If we were to only provide the annotation
at the CLASS
>> >> > > retention
>> >> > > > > > level,
>> >> > > > > > > > > should we still package them in
>> >> > ...annotation.concurrent.clazz
>> >> > > in
>> >> > > > > > case
>> >> > > > > > > we
>> >> > > > > > > > > want to provide annotation.concurrent.runtime
later?
>> >> > > > > > > > >
>> >> > > > > > > > > If we know for certain we never
want to provide RUNTIME
>> >> > > > retention,
>> >> > > > > we
>> >> > > > > > > can
>> >> > > > > > > > > put them all in annotation.concurrent
now.
>> >> > > > > > > > >
>> >> > > > > > > > > Thoughts?
>> >> > > > > > > > >
>> >> > > > > > > > > Gary
>> >> > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > > > [I don't know why the annotations
were ever considered
>> >> > > suitable
>> >> > > > > for
>> >> > > > > > > > > > runtime]
>> >> > > > > > > > > >
>> >> > > > > > > > > > > Gary
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > --
>> >> > > > > > > > > > > E-Mail: garydgregory@gmail.com
|
>> ggregory@apache.org
>> >> > > > > > > > > > > Java Persistence with
Hibernate, Second Edition
>> >> > > > > > > > > > > <https://www.amazon.com/gp/
>> >> product/1617290459/ref=as_li_
>> >> > > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1617290459&
>> >> > > > > > > > > >
>> >> > > > > > >
>> >> > > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> cadb800f39946ec62ea2b1af9fe6a2
>> >> > > b8>
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > <http:////
>> >> > > > > > > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=
>> >> > > > > > > > > > 1617290459>
>> >> > > > > > > > > > > JUnit in Action, Second
Edition
>> >> > > > > > > > > > > <https://www.amazon.com/gp/
>> >> product/1935182021/ref=as_li_
>> >> > > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1935182021&
>> >> > > > > > > > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> > > > > > > 31ecd1f6b6d1eaf8886ac902a24de4
>> >> > > > > > > > > 18%22
>> >> > > > > > > > > > >
>> >> > > > > > > > > > >
>> >> > > > > > > > > > > <http:////
>> >> > > > > > > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=
>> >> > > > > > > > > > 1935182021>
>> >> > > > > > > > > > > Spring Batch in Action
>> >> > > > > > > > > > > <https://www.amazon.com/gp/
>> >> product/1935182951/ref=as_li_
>> >> > > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1935182951&
>> >> > > > > > > > > >
>> >> > linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%
>> >> > > > > > > > > > 7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> >> > > > > > > > > > > <http:////
>> >> > > > > > > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=
>> >> > > > > > > > > > 1935182951>
>> >> > > > > > > > > > > Blog: http://garygregory.wordpress.com
>> >> > > > > > > > > > > Home: http://garygregory.com/
>> >> > > > > > > > > > > Tweet! http://twitter.com/GaryGregory
>> >> > > > > > > > > >
>> >> > > > > > > > > >
>> >> > ------------------------------------------------------------
>> >> > > > > > > ---------
>> >> > > > > > > > > > To unsubscribe, e-mail: dev-unsubscribe@commons.
>> >> apache.org
>> >> > > > > > > > > > For additional commands, e-mail:
>> >> > dev-help@commons.apache.org
>> >> > > > > > > > > >
>> >> > > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > > --
>> >> > > > > > > > > E-Mail: garydgregory@gmail.com |
ggregory@apache.org
>> >> > > > > > > > > Java Persistence with Hibernate,
Second Edition
>> >> > > > > > > > > <https://www.amazon.com/gp/
>> product/1617290459/ref=as_li_
>> >> > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1617290459&
>> >> > > > > > > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> > > > > > cadb800f39946ec62ea2b1af9fe6a2
>> >> > > > > > > b8>
>> >> > > > > > > > >
>> >> > > > > > > > > <http:////ir-na.amazon-adsystem.com/e/ir?t=
>> >> > > > > > garygregory-20&l=am2&o=1&a=
>> >> > > > > > > > > 1617290459>
>> >> > > > > > > > > JUnit in Action, Second Edition
>> >> > > > > > > > > <https://www.amazon.com/gp/
>> product/1935182021/ref=as_li_
>> >> > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1935182021&
>> >> > > > > > > > >
>> >> > > > > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> > > > 31ecd1f6b6d1eaf8886ac902a24de4
>> >> > > > > > 18%22
>> >> > > > > > > > > >
>> >> > > > > > > > >
>> >> > > > > > > > > <http:////ir-na.amazon-adsystem.com/e/ir?t=
>> >> > > > > > garygregory-20&l=am2&o=1&a=
>> >> > > > > > > > > 1935182021>
>> >> > > > > > > > > Spring Batch in Action
>> >> > > > > > > > > <https://www.amazon.com/gp/
>> product/1935182951/ref=as_li_
>> >> > > > > > > > > tl?ie=UTF8&camp=1789&creative=
>> >> 9325&creativeASIN=1935182951&
>> >> > > > > > > > > linkCode=%7B%7BlinkCode%7D%7D&
>> >> tag=garygregory-20&linkId=%7B%
>> >> > > > > > > > > 7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> >> > > > > > > > > <http:////ir-na.amazon-adsystem.com/e/ir?t=
>> >> > > > > > garygregory-20&l=am2&o=1&a=
>> >> > > > > > > > > 1935182951>
>> >> > > > > > > > > Blog: http://garygregory.wordpress.com
>> >> > > > > > > > > Home: http://garygregory.com/
>> >> > > > > > > > > Tweet! http://twitter.com/GaryGregory
>> >> > > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > > --
>> >> > > > > > > > Matt Sicker <boards@gmail.com>
>> >> > > > > > >
>> >> > > > > >
>> >> > > > > >
>> >> > > > > >
>> >> > > > > > --
>> >> > > > > > Matt Sicker <boards@gmail.com>
>> >> > > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > --
>> >> > > > > E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> >> > > > > Java Persistence with Hibernate, Second Edition
>> >> > > > > <
>> >> > > > > https://www.amazon.com/gp/product/1617290459/ref=as_li_
>> >> > > > tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&
>> >> > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> cadb800f39946ec62ea2b1af9fe6a2b8
>> >> > > > > >
>> >> > > > >
>> >> > > > > <http:////
>> >> > > > >
>> >> > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=1617290459
>> >> > > >
>> >> > > > > JUnit in Action, Second Edition
>> >> > > > > <
>> >> > > > > https://www.amazon.com/gp/product/1935182021/ref=as_li_
>> >> > > > tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&
>> >> > > > linkCode=as2&tag=garygregory-20&linkId=
>> >> 31ecd1f6b6d1eaf8886ac902a24de4
>> >> > > 18%22
>> >> > > > > >
>> >> > > > >
>> >> > > > > <http:////
>> >> > > > >
>> >> > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=1935182021
>> >> > > >
>> >> > > > > Spring Batch in Action
>> >> > > > > <
>> >> > > > > https://www.amazon.com/gp/product/1935182951/ref=as_li_
>> >> > > > tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&
>> >> > > > linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%
>> >> > > > 7Blink_id%7D%7D%22%3ESpring+Batch+in+Action
>> >> > > > > >
>> >> > > > > <http:////
>> >> > > > >
>> >> > ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&
>> a=1935182951
>> >> > > >
>> >> > > > > Blog: http://garygregory.wordpress.com
>> >> > > > > Home: http://garygregory.com/
>> >> > > > > Tweet! http://twitter.com/GaryGregory
>> >> > > > >
>> >> > > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > --
>> >> > > Matt Sicker <boards@gmail.com>
>> >> > >
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> > Java Persistence with Hibernate, Second Edition
>> > <https://www.amazon.com/gp/product/1617290459/ref=as_li_
>> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&
>> linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>> >
>> > <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
>> 1617290459>
>> > JUnit in Action, Second Edition
>> > <https://www.amazon.com/gp/product/1935182021/ref=as_li_
>> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&
>> linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22
>> >
>> >
>> > <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
>> 1935182021>
>> > Spring Batch in Action
>> > <https://www.amazon.com/gp/product/1935182951/ref=as_li_
>> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&
>> linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%
>> 7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> > <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
>> 1935182951>
>> > Blog: http://garygregory.wordpress.com
>> > Home: http://garygregory.com/
>> > Tweet! http://twitter.com/GaryGregory
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message