beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.16k stars 109 forks source link

Fix for the free memory marker of TornadoVM when running multi-threaded execution plans #378

Closed jjfumero closed 3 months ago

jjfumero commented 3 months ago

Description

This PR fixes the multi-threaded deallocation marker within the TornadoVM runtime. This PR also fixes the code in the GAIA project.

Problem description

The issue was that we need to guarantee that the deallocator marker is executed in sychronized mode, and guarantee that the unused buffer item in the list was not null. It can be null if it references the same host memory object (e.g., the same Panama-based array).

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

How to test the new patch?

$ make 
$ tornado-test -V --fast uk.ac.manchester.tornado.unittests.multithreaded.TestMultiThreadedExecutionPlans