You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by rectang <gi...@git.apache.org> on 2015/02/09 07:36:23 UTC
[lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish refcounting API cha...
GitHub user rectang opened a pull request:
https://github.com/apache/lucy/pull/8
LUCY-274 Adapt to Clownfish refcounting API changes
This fixes LUCY-274.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rectang/lucy LUCY-274-refcount_functions
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucy/pull/8.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #8
----
commit 9776399a9d7e03269520989c45c2bbfeb474e233
Author: Marvin Humphrey <ma...@rectangular.com>
Date: 2015-02-09T05:59:59Z
Cease using refcount method API.
commit 58b8f946c9c564a8db00f8895866f53678e4cc24
Author: Marvin Humphrey <ma...@rectangular.com>
Date: 2015-02-09T06:00:25Z
Change RawPosting refcounting.
Cease overriding refcount manipulation methods. Make destructor a
no-op.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish
refcounting API cha...
Posted by Nick Wellnhofer <we...@aevum.de>.
On 13/02/2015 03:48, Marvin Humphrey wrote:
> On Thu, Feb 12, 2015 at 2:42 PM, Nick Wellnhofer <we...@aevum.de> wrote:
>> Another example is
>> Atomic_cas_ptr in Util/Atomic.cfh. We have to carry around a bunch of
>> feature macros just for a single inline function that's only used
>> internally.
>
> +1
>
> Clownfish should not be in the business of providing atomics as a
> user-level feature.
Here's a commit that makes the atomic utils private to the Clownfish runtime:
https://github.com/apache/lucy-clownfish/commit/38d547a57b322ed39c44400bd660c53c1adbc092
Nick
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to
Clownfish refcounting API cha...
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Thu, Feb 12, 2015 at 2:42 PM, Nick Wellnhofer <we...@aevum.de> wrote:
> I wouldn't mind if we hid more of Clownfish's internals.
Yes, absolutely.
Clownfish continues to carry some artifacts from the way it evolved: it was
not spec'd out and then implemented from scratch but instead factored out of
Lucy, which has been kept working continuously the entire time with
comparatively few changes to its API.
Overall, having a concrete use case has been extremly positive, but some
decisions made for the sake of expediency have resulted in misfeatures and
defects in the visible Clownfish interface. The sooner we clean up those
messes, the better.
Implementing LockFreeRegistry as a Clownfish class made it straightforward to
write Perl bindings and tests for it, but turns out not to have been an
optimal design choice. I'll work up a pull request.
> Another example is
> Atomic_cas_ptr in Util/Atomic.cfh. We have to carry around a bunch of
> feature macros just for a single inline function that's only used
> internally.
+1
Clownfish should not be in the business of providing atomics as a
user-level feature.
Perhaps one day we will discover that they need to be in generated binding
code for Clownfish-powered libraries, but I'm pretty sure that at present we
only use them in the code which ends up in the main Clownfish shared object.
> It would be nice if we could mark certain .cfh files for internal use in a
> parcel so they wouldn't be installed.
Hmm, adding a feature that allows us to take away features. :)
Marvin Humphrey
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish
refcounting API cha...
Posted by Nick Wellnhofer <we...@aevum.de>.
On 12/02/2015 20:17, Marvin Humphrey wrote:
> It would simplify bootstrapping if it wasn't even a Clownfish data structure,
> so that it didn't need method calls or object initialization. I'm having to
> insert some fragile hacks in the Python bindings because of mutual
> dependencies between Python type and module objects plus Class, Method,
> LockFreeRegistry, and String during boot.
I wouldn't mind if we hid more of Clownfish's internals. Another example is
Atomic_cas_ptr in Util/Atomic.cfh. We have to carry around a bunch of feature
macros just for a single inline function that's only used internally.
It would be nice if we could mark certain .cfh files for internal use in a
parcel so they wouldn't be installed.
Nick
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to
Clownfish refcounting API cha...
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Thu, Feb 12, 2015 at 4:27 AM, Nick Wellnhofer <we...@aevum.de> wrote:
> On 11/02/2015 05:13, Marvin Humphrey wrote:
>> I've added a new commit on that branch which implements your
>> suggestion (updating the pull request):
>>
>>
>> https://github.com/rectang/lucy-clownfish/commit/c0b90906746d3825e3fc9fd41d023aa727e07b13
>
>
> Nice.
OK, cool -- I'm going to merge these two pull requests to the lucy and
clownfish master branches today, then.
> Another question: Do we really need the "thread-safe but not immortal"
> distinction for LFReg?
FWIW, there's zero cost difference whether it's in that group or another, and
it's not technically immortal. If it had gone in the "immortal" group, that
group would have needed another name.
Calling attention to its special status was somewhat deliberate. ;)
> If we keep LFReg as an implementation detail, we
> could just treat it as an immortal class. This would simplify things as we
> wouldn't need atomic operations for refcount handling. (We probably never
> incref the class registry anyway.)
It would simplify bootstrapping if it wasn't even a Clownfish data structure,
so that it didn't need method calls or object initialization. I'm having to
insert some fragile hacks in the Python bindings because of mutual
dependencies between Python type and module objects plus Class, Method,
LockFreeRegistry, and String during boot.
> As a side note, our immutable String class is "thread-safe but not
> immortal", too. We could make it completely thread-safe with atomic refcount
> operations. But I wouldn't want to go down that way, since atomic operations
> are rather costly.
I contemplated special-casing String's refcounting and reached the same
conclusion.
Marvin Humphrey
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish
refcounting API cha...
Posted by Nick Wellnhofer <we...@aevum.de>.
On 11/02/2015 05:13, Marvin Humphrey wrote:
> On Mon, Feb 9, 2015 at 4:55 AM, Nick Wellnhofer <we...@aevum.de> wrote:
>> Looks great. One remaining issue are the String ivars in Class and Method.
>> These are immortal and shared across threads, so they need special refcount
>> handling, too. My original plan was to use a per-object immortal flag, but
>> I'd prefer a solution that doesn't need such a flag. I think it should work
>> to use "wrapped" strings in Class and Method and rely on the fact that these
>> will be copied when incref'd.
>
> I've added a new commit on that branch which implements your
> suggestion (updating the pull request):
>
> https://github.com/rectang/lucy-clownfish/commit/c0b90906746d3825e3fc9fd41d023aa727e07b13
Nice.
Another question: Do we really need the "thread-safe but not immortal"
distinction for LFReg? If we keep LFReg as an implementation detail, we could
just treat it as an immortal class. This would simplify things as we wouldn't
need atomic operations for refcount handling. (We probably never incref the
class registry anyway.)
As a side note, our immutable String class is "thread-safe but not immortal",
too. We could make it completely thread-safe with atomic refcount operations.
But I wouldn't want to go down that way, since atomic operations are rather
costly.
Nick
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to
Clownfish refcounting API cha...
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Mon, Feb 9, 2015 at 4:55 AM, Nick Wellnhofer <we...@aevum.de> wrote:
> On 09/02/2015 07:55, Marvin Humphrey wrote:
>>
>> The more interesting pull request is the one against Clownfish, which
>> didn't trigger a dev list email:
>>
>> https://github.com/apache/lucy-clownfish/pull/3
>
>
> Looks great. One remaining issue are the String ivars in Class and Method.
> These are immortal and shared across threads, so they need special refcount
> handling, too. My original plan was to use a per-object immortal flag, but
> I'd prefer a solution that doesn't need such a flag. I think it should work
> to use "wrapped" strings in Class and Method and rely on the fact that these
> will be copied when incref'd.
I've added a new commit on that branch which implements your
suggestion (updating the pull request):
https://github.com/rectang/lucy-clownfish/commit/c0b90906746d3825e3fc9fd41d023aa727e07b13
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish
refcounting API cha...
Posted by Nick Wellnhofer <we...@aevum.de>.
On 09/02/2015 07:55, Marvin Humphrey wrote:
> The more interesting pull request is the one against Clownfish, which
> didn't trigger a dev list email:
>
> https://github.com/apache/lucy-clownfish/pull/3
Looks great. One remaining issue are the String ivars in Class and Method.
These are immortal and shared across threads, so they need special refcount
handling, too. My original plan was to use a per-object immortal flag, but I'd
prefer a solution that doesn't need such a flag. I think it should work to use
"wrapped" strings in Class and Method and rely on the fact that these will be
copied when incref'd.
Nick
Re: [lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to
Clownfish refcounting API cha...
Posted by Marvin Humphrey <ma...@rectangular.com>.
The more interesting pull request is the one against Clownfish, which
didn't trigger a dev list email:
https://github.com/apache/lucy-clownfish/pull/3
I've filed an Infra issue to get the other Git repos set up with
Github hooks like lucy.git:
https://issues.apache.org/jira/browse/INFRA-9141
Marvin Humphrey
On Sun, Feb 8, 2015 at 10:36 PM, rectang <gi...@git.apache.org> wrote:
> GitHub user rectang opened a pull request:
>
> https://github.com/apache/lucy/pull/8
>
> LUCY-274 Adapt to Clownfish refcounting API changes
[lucy-dev] [GitHub] lucy pull request: LUCY-274 Adapt to Clownfish refcounting API cha...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/lucy/pull/8
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---