[
https://issues.apache.org/jira/browse/LUCY-233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409959#comment-13409959
]
Marvin Humphrey commented on LUCY-233:
--------------------------------------
Nice improvements! I like how lucy_bootstrap_parcel() has become shorter and
easier to grok now that it has a loop instead of a couple hundred function
calls. :) And thanks for addressing the handful of concerns from the initial
go-round.
+1 to commit the second patch sequence.
> Now that VTables are allocated on the heap, I'm not sure if overriding
> Inc_RefCount and Dec_RefCount is still needed. I think we could and should
> use a normal destructor now. The same for Methods.
Hmm, that would make these objects mutable -- and that poses a problem, as
they are shared globals. Clownfish is designed to support strongly divorced
concurrency in threads; VTables -- and now Methods -- are shared, but they are
the *only* objects which can be shared. Having VTables be shared singletons
is a deeply-baked-in assumption for the current design. If we make them
mutable, we will still need to override all refcount manipulation and access
methods, to provide for threadsafe incrementing and decrementing -- the
default refcount manipulation methods inherited from Obj are not atomic.
We would also have problems if VTables or Methods were to be freed before any
objects which hold references to them. This can happen under out-of-order
refcount decrementing during Perl's global destruction phase:
http://markmail.org/message/52i2n7f2ma5jlajc
> Implement Clownfish Method class
> --------------------------------
>
> Key: LUCY-233
> URL: https://issues.apache.org/jira/browse/LUCY-233
> Project: Lucy
> Issue Type: Task
> Components: Clownfish
> Reporter: Nick Wellnhofer
> Attachments: 0001-Rename-METHOD-macro-to-METHOD_PTR.patch,
> 0002-Rework-VTable-bootstrapping.patch,
> 0003-Initial-implementation-of-Method-class.patch,
> 0004-Rework-VTable-method-initialization.patch,
> 0101-Rename-METHOD-macro-to-METHOD_PTR.patch,
> 0102-Rework-VTable-bootstrapping.patch,
> 0103-Initial-implementation-of-Method-class.patch,
> 0104-Rework-VTable-method-initialization.patch,
> 0105-Autogenerate-an-array-with-initialization-data-for-a.patch,
> take1_take2.diff
>
>
> As discussed on lucy-dev, it would be nice to have a Clownfish class for
> methods. The VTables would then contain a VArray of Methods which can be used
> to setup host language overrides and later to lookup offsets dynamically.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira