RustPython icon indicating copy to clipboard operation
RustPython copied to clipboard

Introduce PyAtomicRef and impl for PyObject.typ

Open qingshi163 opened this issue 2 years ago • 9 comments

@youknowone correctness and performance check?

qingshi163 avatar Jun 29 '22 15:06 qingshi163

Feel free to ignore those Clippy failures. @youknowone likely missed them in https://github.com/RustPython/RustPython/pull/3817.

fanninpm avatar Jun 29 '22 16:06 fanninpm

#3970

qingshi163 avatar Aug 07 '22 14:08 qingshi163

Is this approach safe as we manaully require the reference to the pytype cannot across between the frames. Most of the case we use the pytype is either using pytyperef or using the reference immediately. @youknowone

qingshi163 avatar Aug 08 '22 10:08 qingshi163

Oh, I missed your last push. I will check the changes soon.

youknowone avatar Aug 22 '22 08:08 youknowone

(using PyAtomic instead of AtomicCell would fix the provenance errors in miri)

coolreader18 avatar Aug 29 '22 17:08 coolreader18

(using PyAtomic instead of AtomicCell would fix the provenance errors in miri)

let me try

qingshi163 avatar Aug 29 '22 17:08 qingshi163

Also, vm.frames should definitely be made private now, since it's now a safety thing that a frame cannot be popped off the frame stack + dropped before it's fully done running.

coolreader18 avatar Aug 29 '22 18:08 coolreader18

(using PyAtomic instead of AtomicCell would fix the provenance errors in miri)

let me try

Don't know why but seem like failing the compile when threading is off, any mistake about how to use PyAtomic? @coolreader18

qingshi163 avatar Aug 29 '22 19:08 qingshi163

(using PyAtomic instead of AtomicCell would fix the provenance errors in miri)

let me try

Don't know why but seem like failing the compile when threading is off, any mistake about how to use PyAtomic? @coolreader18

nevermind, it just the name conflict

qingshi163 avatar Aug 31 '22 18:08 qingshi163

@coolreader18 @youknowone review?

qingshi163 avatar Oct 02 '22 18:10 qingshi163