AtomicReference?

View: New views
7 Messages — Rating Filter:   Alert me  

AtomicReference?

by Paul Stadig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Another one of the larger issues with getting Clojure to work with TC is the lack of support for AtomicReference. Are there plans to support it?

Again I'm able to work around this by using class replacement and rewriting some of the Clojure classes in my TIM, but obviously it would be easier to maintain if AtomicReference were supported.

I've gotten quite a bit of interest from by work getting Clojure to run on TC, so I think some people are waiting to see how well it will work.


Paul


_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by Alex Miller-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Our PM was playing with that recently.  Certainly would love to  
support it (all a matter of time).  Interested in developing a patch?  
We could give you some pointers.


On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:

> Another one of the larger issues with getting Clojure to work with  
> TC is the lack of support for AtomicReference. Are there plans to  
> support it?
>
> Again I'm able to work around this by using class replacement and  
> rewriting some of the Clojure classes in my TIM, but obviously it  
> would be easier to maintain if AtomicReference were supported.
>
> I've gotten quite a bit of interest from by work getting Clojure to  
> run on TC, so I think some people are waiting to see how well it  
> will work.
>
>
> Paul
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by Paul Stadig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would be glad to work on a patch. It might be a bit overwhelming to jump into the code base, but if you have some pointers that would be great.

Paul

On Thu, Apr 2, 2009 at 4:37 PM, Alex Miller <amiller@...> wrote:
Our PM was playing with that recently.  Certainly would love to
support it (all a matter of time).  Interested in developing a patch?
We could give you some pointers.


On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:

> Another one of the larger issues with getting Clojure to work with
> TC is the lack of support for AtomicReference. Are there plans to
> support it?
>
> Again I'm able to work around this by using class replacement and
> rewriting some of the Clojure classes in my TIM, but obviously it
> would be easier to maintain if AtomicReference were supported.
>
> I've gotten quite a bit of interest from by work getting Clojure to
> run on TC, so I think some people are waiting to see how well it
> will work.
>
>
> Paul
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users


_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by teck-terracotta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Probably don't need many pointers really. AtomicReference uses the CAS
methods from sun.misc.Unsafe. TC already has its grubby paws down in there
so I think all one needs to do is remove the permanent exclude for that
type (org.terracotta.modules.ExcludesConfiguration) and to write a test
(com.tctest.jdk15.AtomicBooleanTest is probably a good example).


> -----Original Message-----
> From: tc-users-bounces@... [mailto:tc-users-
> bounces@...] On Behalf Of Alex Miller
> Sent: Thursday, April 02, 2009 1:38 PM
> To: tc-users@...
> Subject: Re: [tc-users] AtomicReference?
>
> Our PM was playing with that recently.  Certainly would love to
> support it (all a matter of time).  Interested in developing a patch?
> We could give you some pointers.
>
>
> On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:
>
> > Another one of the larger issues with getting Clojure to work with
> > TC is the lack of support for AtomicReference. Are there plans to
> > support it?
> >
> > Again I'm able to work around this by using class replacement and
> > rewriting some of the Clojure classes in my TIM, but obviously it
> > would be easier to maintain if AtomicReference were supported.
> >
> > I've gotten quite a bit of interest from by work getting Clojure to
> > run on TC, so I think some people are waiting to see how well it
> > will work.
> >
> >
> > Paul
> >
> > _______________________________________________
> > tc-users mailing list
> > tc-users@...
> > http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
It wasn't terribly hard except I think that the default boot-jar include/excludes stopped me from implementing it as a TIM. 

I could post the code I have for it if you like - basically it amounted to trying to do a wholesale replacement of the bytecodes for AtomicReference from Java's class to the one I wrote.  Implementing the method interfaces is pretty easy for AtomicReference using just regular java and synchronization.

Basically I had the instrumented bytes ready to go, but I couldn't get them into the boot-jar for use by TC because of some hard-coding in the TC code.  At least that is my suspicion.  What that unfortunately means is that you would need a patched TC (others could likely help you out to identify what is hard-coded that prevented me from moving forward) and the TIM.  I can't see why we wouldn't be amenable to adding the patch (not the TIM or support for j.u.c.a.AR - just the patch to allow a TIM) to a follow on release like 3.0.1 if we had the patch and felt reasonably comfortable with it.

Of course the TIM approach would not be as fast as AtomicReference for non-clustered instances, but would work "transparently" in the use case as a stop-gap until the product supports it proper.


----- Original Message -----
From: "Paul Stadig" <paul@...>
To: tc-users@...
Sent: Thursday, April 2, 2009 1:39:03 PM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] AtomicReference?

I would be glad to work on a patch. It might be a bit overwhelming to jump into the code base, but if you have some pointers that would be great.

Paul

On Thu, Apr 2, 2009 at 4:37 PM, Alex Miller <amiller@...> wrote:
Our PM was playing with that recently.  Certainly would love to
support it (all a matter of time).  Interested in developing a patch?
We could give you some pointers.


On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:

> Another one of the larger issues with getting Clojure to work with
> TC is the lack of support for AtomicReference. Are there plans to
> support it?
>
> Again I'm able to work around this by using class replacement and
> rewriting some of the Clojure classes in my TIM, but obviously it
> would be easier to maintain if AtomicReference were supported.
>
> I've gotten quite a bit of interest from by work getting Clojure to
> run on TC, so I think some people are waiting to see how well it
> will work.
>
>
> Paul
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users


_______________________________________________ tc-users mailing list tc-users@... http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by Alex Miller-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You will also need to sign a contributor agreement but we can get you  
the info on that.

This is actually a really nice task for someone external to tc to work  
on (and one I'm sure others will find useful).

The tc-dev list might be a better place to follow up with more  
questions on the details.



On Apr 2, 2009, at 3:42 PM, Tim Eck wrote:

> Probably don't need many pointers really. AtomicReference uses the CAS
> methods from sun.misc.Unsafe. TC already has its grubby paws down in  
> there
> so I think all one needs to do is remove the permanent exclude for  
> that
> type (org.terracotta.modules.ExcludesConfiguration) and to write a  
> test
> (com.tctest.jdk15.AtomicBooleanTest is probably a good example).
>
>
>> -----Original Message-----
>> From: tc-users-bounces@... [mailto:tc-users-
>> bounces@...] On Behalf Of Alex Miller
>> Sent: Thursday, April 02, 2009 1:38 PM
>> To: tc-users@...
>> Subject: Re: [tc-users] AtomicReference?
>>
>> Our PM was playing with that recently.  Certainly would love to
>> support it (all a matter of time).  Interested in developing a patch?
>> We could give you some pointers.
>>
>>
>> On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:
>>
>>> Another one of the larger issues with getting Clojure to work with
>>> TC is the lack of support for AtomicReference. Are there plans to
>>> support it?
>>>
>>> Again I'm able to work around this by using class replacement and
>>> rewriting some of the Clojure classes in my TIM, but obviously it
>>> would be easier to maintain if AtomicReference were supported.
>>>
>>> I've gotten quite a bit of interest from by work getting Clojure to
>>> run on TC, so I think some people are waiting to see how well it
>>> will work.
>>>
>>>
>>> Paul
>>>
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: AtomicReference?

by Alex Miller-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul seems to have a workaround for now it seems.  I'd rather focus on getting it into core then wedging it into a tim. 


On Apr 2, 2009, at 3:47 PM, Taylor Gautier wrote:

It wasn't terribly hard except I think that the default boot-jar include/excludes stopped me from implementing it as a TIM. 

I could post the code I have for it if you like - basically it amounted to trying to do a wholesale replacement of the bytecodes for AtomicReference from Java's class to the one I wrote.  Implementing the method interfaces is pretty easy for AtomicReference using just regular java and synchronization.

Basically I had the instrumented bytes ready to go, but I couldn't get them into the boot-jar for use by TC because of some hard-coding in the TC code.  At least that is my suspicion.  What that unfortunately means is that you would need a patched TC (others could likely help you out to identify what is hard-coded that prevented me from moving forward) and the TIM.  I can't see why we wouldn't be amenable to adding the patch (not the TIM or support for j.u.c.a.AR - just the patch to allow a TIM) to a follow on release like 3.0.1 if we had the patch and felt reasonably comfortable with it.

Of course the TIM approach would not be as fast as AtomicReference for non-clustered instances, but would work "transparently" in the use case as a stop-gap until the product supports it proper.


----- Original Message -----
From: "Paul Stadig" <paul@...>
To: tc-users@...
Sent: Thursday, April 2, 2009 1:39:03 PM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] AtomicReference?

I would be glad to work on a patch. It might be a bit overwhelming to jump into the code base, but if you have some pointers that would be great.

Paul

On Thu, Apr 2, 2009 at 4:37 PM, Alex Miller <amiller@...> wrote:
Our PM was playing with that recently.  Certainly would love to
support it (all a matter of time).  Interested in developing a patch?
We could give you some pointers.


On Apr 2, 2009, at 3:25 PM, Paul Stadig wrote:

> Another one of the larger issues with getting Clojure to work with
> TC is the lack of support for AtomicReference. Are there plans to
> support it?
>
> Again I'm able to work around this by using class replacement and
> rewriting some of the Clojure classes in my TIM, but obviously it
> would be easier to maintain if AtomicReference were supported.
>
> I've gotten quite a bit of interest from by work getting Clojure to
> run on TC, so I think some people are waiting to see how well it
> will work.
>
>
> Paul
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users


_______________________________________________ tc-users mailing list tc-users@... http://lists.terracotta.org/mailman/listinfo/tc-users
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users


_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users