polyglot-compiler / JLang

JLang: Ahead-of-time compilation of Java programs to LLVM
http://polyglot-compiler.github.io/JLang/
Other
287 stars 30 forks source link

Support synchronization, conditional variable, and multithreading in runtime #52

Closed guoyiteng closed 4 years ago

guoyiteng commented 4 years ago

I fixed all the issues mentioned here. If everything looks good to you, we can merge this PR. Then, I will create another PR of Interrupt for you to review.

guoyiteng commented 4 years ago

Bad news... Synchronization issues show up again when I heavily use reflections in parallel (ConcurrentReflection test). It's really difficult to debug this kind of issue. I will look into this problem later this week.

dz333 commented 4 years ago

Ok sounds good. I totally understand haha, these are definitely painful issues to debug :)

guoyiteng commented 4 years ago

Ok, I managed to handle the synchronization issues here but sadly found other reflection bugs. The fixes are here https://github.com/guoyiteng/JLang/pull/1. That PR also includes interrupt implementation. I created a separate PR since this PR #52 has already been very large. It would be a hard time for you to review if I pushed more fixes on it.

Here are two options I have in mind to handle these PRs.

  1. We merged this PR #52 first. Currently, #52 passed all the test cases except the ConcurrentReflection.java. I think it is ok to merge it into master. Then, I moved the PR from my repo to this repo for you to review.

  2. If you think it is not ok to merge this PR now, feel free to review the fixes here https://github.com/guoyiteng/JLang/pull/1. After the review is done, I can merge it to #52 and then we merge #52 to the master. I will definitely copy our discussions from the PR in my repo to this PR for future references.

dz333 commented 4 years ago

Ok this looks good. I'll merge and create an issue to track that calling into reflection can break things.