Bug 3811 – Shared cannot be implemented properly in druntime's array functions (lifetime.d)

Status
NEW
Severity
major
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-02-18T06:46:20Z
Last change time
2024-12-07T13:30:51Z
Assigned to
Sean Kelly
Creator
Steven Schveighoffer
Moved to GitHub: dmd#17221 →

Comments

Comment #0 by schveiguy — 2010-02-18T06:46:20Z
There are several array functions which accept TypeInfo for the array type being operated on. However, the assumption is made that the type applies to all arguments. This is fine for non-shared arrays, but for shared arrays, reading data from that array must be done with proper synchronization. For example, it should be possible to concatenate both a shared and local array into a new array, or append the contents of a shared array to a non-shared array. Therefore, there needs to be typeinfo passed in for each argument to the array functions, and action should be taken appropriately. Alternatively, the compiler could call different versions of the function depending on the shared status of the arguments. This should be minimal, and might help performance since runtime checks would not be needed. Note also that two new functions in druntime do not pass in a TypeInfo reference because they are specific to wchar[] and char[]. Those functions need to undergo the same issue. Fixing this issue depends on the solidification and proper implementation of shared in the spec and compiler respectively.
Comment #1 by robert.schadek — 2024-12-07T13:30:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17221 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB