Need help for reading data in multithreading

Support
  • 6cbf7bf6-e278-4bfa-bd2e-de75a8251fa5-image.png

    On the database I have 2 values ​​as above. now every time it completes I will -1 the value and update it to the database, when it completes it will stop the script, but in multithreading for example I have 2 rows it seems to work properly but when running 3 threads it doesn't work properly

    help me