[
https://issues.apache.org/jira/browse/CLOWNFISH-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15189937#comment-15189937
]
ASF GitHub Bot commented on CLOWNFISH-78:
-----------------------------------------
GitHub user nwellnhof opened a pull request:
https://github.com/apache/lucy-clownfish/pull/63
Make bootstrap process thread-safe
Fixes CLOWNFISH-78.
I chose a different approach than envisioned initially.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nwellnhof/lucy-clownfish threadsafe-bootstrap
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucy-clownfish/pull/63.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 #63
----
commit dc56c144cace1d9faa70e857ae98596cfee2329d
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T14:11:36Z
Implement dtors for Class and Method
Only for internal use. Destructors of immortal types won't be invoked
via DECREF, so they must be called directly.
commit ce1fe99cf3f45045af77bf717da3b17cb6549ffd
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T17:34:33Z
Start to make Class_bootstrap thread-safe
Use Atomic_cas_ptr to write
- global class pointer
- class name
- class method array
commit d7c863b92dae97fd8a7eea93364941607e4921e1
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T18:06:53Z
Make bootstrap_parcel thread-safe
Remove bootstrap_inheritance.
Add bootstrap_internal which invokes Class_bootstrap and parcel_init only
for a single parcel.
Detect inheritance cycles in Class_bootstrap.
commit 7528af4514e1ddea3c99bf9f6dcc4392c1f1b8e2
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T18:33:51Z
Make cfish_init_parcel thread-safe
Initialize globals with compare-and-swap.
commit 7cc75eb8dd53bb63966170629ec66cdbc62e7d34
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T19:05:20Z
Test idempotence of bootstrap process
commit 70f2562db5dbd3614b8a6b36f2a1562cdf7f9e05
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T19:48:58Z
Keep CLASS->obj_alloc_size at 0
This makes sure that Init_Obj doesn't reset any values when bootstrapping.
commit 8b71db60c361fde4135e7b16b4e018a48bae1d2f
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T20:15:12Z
Introduce struct cfish_ParcelSpec
Change Class_bootstrap to take a single pointer to struct
cfish_ParcelSpec.
commit 25f58a6a5267ba8b33bbe00f8a25fa58c490e585
Author: Nick Wellnhofer <[email protected]>
Date: 2016-03-10T20:19:21Z
Replace parcel_id with ParcelSpec pointer
This makes the check whether a class is in the same parcel thread-safe.
----
> Bootstrap process isn't thread-safe
> -----------------------------------
>
> Key: CLOWNFISH-78
> URL: https://issues.apache.org/jira/browse/CLOWNFISH-78
> Project: Apache Lucy-Clownfish
> Issue Type: Bug
> Reporter: Nick Wellnhofer
>
> The Clownfish bootstrap process isn't thread-safe. For a lock-free solution:
> - Class_bootstrap must set the global class pointer at the very end, possibly
> destroying the class if another thread set the pointer before.
> - The runtime inheritance cycle detection must be reworked, or simply left
> out. It only protects from a really contrived scenario.
> - Probably other things I missed.
> We could also consider a global lock using a locking facility provided by the
> host language.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)