ScratchData LogoScratchData
Back to grandpasp2's profile

Test cloud lock

GRgrandpasp2•Created April 2, 2024
Test cloud lock
0
1
73 views
View on Scratch

Instructions

This project simulates the requirements of a cloud-based leaderboard that must account for the chance that multiple copies of a project may be trying to update the cloud vars simultaneously. It runs a loop of 8 "rapid-fire" writes. I've been running 2 copies (1 on each of my 2 accounts) to simulate "collisions". So far the results are encouraging.

Description

I've also accounted for the user clicking the stop flag in the middle of writing out the set of vars. I intercept the stop, and continue the write (only if it was previously in progress) to make sure the list does not get corrupted and to make sure the "lock" var gets reset. This requires that the write vars routine be re-enterable. You may test this yourself by clicking the stop flag in the middle of the cloud vars changing.

Project Details

Project ID993590583
CreatedApril 2, 2024
Last ModifiedJuly 19, 2024
SharedApril 2, 2024
Visibilityvisible
CommentsAllowed