Comments (4)
Considered relevant during sync: https://stackoverflow.com/questions/9116951/what-is-the-meaning-of-restrict-in-pthread-create
from ponyc.
I think I was convinced over the duration of the sync call that this is indeed a spec violation (but I may still be under-informed on the issue, so I could be wrong). That is, I was convinced that some future version of clang
could add an optimization that leverages the restrict
qualifier in a way that breaks our usage of pthread_create
.
The violation seems to be that our first arg and final arg to pthread_create
are overlapping in memory, because the pony_thread_id_t
struct reference we pass as the first arg is embedded within the scheduler_t
reference which we pass as the final arg. Because they address an overlapping memory region, certain optimizations allowed by the restrict
qualifier could cause a copy operation to clobber the view as seen by one or the other.
One way to avoid this would be to not embed the pony_thread_id_t
- we could, for example, pool-allocate it instead. Or keep it in a separate struct array perhaps.
from ponyc.
I'm not convinced this is an issue. We should discuss together at some point @jemc. I agree it is a violation of the quoted posix spec but I'm not sure that matters, what matters is whether that spec is implemented by our target platforms.
from ponyc.
Joe and I discussed at sync today. We both agree this could be an issue.
I'm more worried that someone fixing this issue is likely to introduce bugs than clang and other compilers will start to follow this portion of the spec. I'm fine with someone fixing the issue herein so long as there is a test plan to make sure no bugs are introduced with the change to address the spec violation.
from ponyc.
Related Issues (20)
- Incorrect generic FFI syntax compiles HOT 10
- Runtime crash when accessing a field that was captured before it was initialized HOT 2
- Feat: Reconsider support for ponyc bundled builds targeting Intel MacOS HOT 1
- runaway memory growth during GC with reference cycle HOT 12
- RFC #77: Assign Param Syntax
- RFC #78: Remove JSON package from the standard library
- Can't built 0.53.0 on aarch64-darwin HOT 8
- Release 0.54.1 HOT 2
- iftype compile error at runtime HOT 7
- [Epic] EL 9 & Fedora support - prebuilt, install.md, and ponyup HOT 1
- XorOshiro naming in random HOT 2
- Incorrect program result when not using --debug HOT 16
- Release 0.55.0
- Segmentation fault when capturing Env via lambda HOT 17
- Segfault when trying to compile incorrect capabilities HOT 12
- With block doesn't call dispose on an object if its name is _ HOT 7
- Web assembly
- Unreported type inference error with Array's in match case statements HOT 9
- Cannot build with --static nor --nopic. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ponyc.