# Built in locking or semaphore mechanism

**URL:** https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593
**Category:** Feature Requests
**Created:** [July 2, 2021, 1:08am UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593 "2021-07-02T01:08:40Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [July 4, 2021, 11:27am UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/21 "2021-07-04T11:27:12Z")

</div>

This will not work - as every device thinks it has the sole truth. The last one in over-writes the previous user’s input. And even if you use a timestamp, you can lock all users by forcing all of them to wait (and I did this in one iteration of my app, with @Darren_Murphy 's help) … to then finally resolve who the winner was, but that took about 2 mins in practice, and I had a loser who wasted time, and a winner who wasted time.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 1:16pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/22 "2021-07-04T13:16:03Z")

</div>

Now who wants to vote for the feature request? 😀

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 4, 2021, 1:27pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/23 "2021-07-04T13:27:30Z")

</div>

Vald, it didn’t work. You can see in this attached video that except for item 3, I was able double book every other item. Once for each user. Neither user was aware that the other had booked because the client does not check with the server first to see if any other users have edited the row. It works with the local database copy instead…which may be updated a few seconds later…but not quickly enough to verify if others have touched a row at the same time on their own copy of the database. This allowed for the creation of double bookings that you can see in the Release DATA list. Your method can work so long as users aren’t rapidly booking at the same time, but the way Glide is currently designed with separate databases (google sheet, glide server, and a copy on every user device) there isn’t currently a way to check with the server first before making any changes to data. It always happens locally first, then syncs to the server. Most websites are different from PWA’s because on websites, all or most processing happens server side. On a PWA. however, all or most processing happens on the local device.

> **[Google Chrome - Time & Address Picker · TEST · Made with Glide - Google...](https://www.loom.com/share/6ebb19fb9be34e60b5df729269516ee6)**

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/9/89f24377cb9894200354b2f4b36251c8527e9874.png)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [July 4, 2021, 1:30pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/24 "2021-07-04T13:30:42Z")

</div>

I would, but I used all my votes already 😥

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 1:37pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/25 "2021-07-04T13:37:00Z")

</div>

Thanks so much for doing the test Jeff. I was just sitting down to try it but it would have taken me quite a bit of work to setup email addresses and to post the video. Awesome.

Thanks for everyone’s comments.

And to anyone in the USA happy Independence Day

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [July 4, 2021, 1:37pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/26 "2021-07-04T13:37:26Z")

</div>

You can unvote old items and vote again 🙂

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 5:43pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/27 "2021-07-04T17:43:37Z")

</div>

very funny @Jeff_Hager ! lol… i see what you did…  
i modified it just for your fast mouse… try it again!

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 5:53pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/28 "2021-07-04T17:53:02Z")

</div>

and please make video to show that I beat the Great JEFF ! lol… just kidding.  
Happy 4th of July! @Gary_Biagioni @Darren_Murphy @Mark_Turrell @Roldy @Jeff_Hager

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 6:58pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/29 "2021-07-04T18:58:28Z")

</div>

With my technique, is only up to 5 seconds of wasting time

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 4, 2021, 8:39pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/30 "2021-07-04T20:39:59Z")

</div>

Round 2. No practice. Just did a straight refresh of both instances of the app after I started recording to get the latest version and run through the list again. Can still get double bookings. This would be much worse if 50, 100, or 1000 people were fighting for the same booking at the same time.

> **[Google Chrome - Time & Address Picker · semaphore mechanism · Made with...](https://www.loom.com/share/a304840be3a34e94a8c3eb4602fafcbc)**

And just for everybody’s information, I’m using a windows laptop with a touch screen, so that’s how I can tap quickly between apps. The left app is in a normal Chrome session. The second app is in an Incognito Chrome session so I can be signed in as a different user. I’m doing this to simulate and record what would happen with two separate users accessing the same parts of the same app at the same time. Again, the effects would be much worse if there were 100’s or 1000’s of users doing the same thing at the same time.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 8:53pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/31 "2021-07-04T20:53:22Z")

</div>

it looks like you used old link… try again with new one @Jeff_Hager

> **[Time & Address Picker](https://sa-test.glideapp.io/dl/ewAiAHQAIgA6ADcALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0AcwBlAG0AYQBwAGgAbwByAGUAIgAsACIAcgAiADoAIgA2AEIAWABpAFgAdwBCADUAUgAyAEcAdgBpAHEARgBhAEwANgB2AFkAawBBACIALAAiAG4AIgA6ACIAcwBlAG0AYQBwAGgAbwByAGUAIABtAGUAYwBoAGEAbgBpAHMAbQAiAH0A)**
>
> vCard + pick the time using buttons + enter address or place name, and this App will find the proper address and geolocation

thank you for testing!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 4, 2021, 9:08pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/32 "2021-07-04T21:08:32Z")

</div>

Round 3, that seemed better.

> **[Google Chrome - Built in locking or semaphore mechanism - Feature Requests -...](https://www.loom.com/share/0c5ba153f35e4d28866717fedc10c45d)**

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 9:19pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/33 "2021-07-04T21:19:13Z")

</div>

IMHO you can get him to test a bunch of different scenarios. But really with any time delay between app updates will make it so that you can not obtain a true lock. You may decrease the likely hood of double booking but you can not ever get rid of the ability to double book.

The lock has to be asked for from a source and then returned by that source. Any further requests for a lock have to be rejected by the source until the lock is given up by the requestor or a timeout occurs (if there is a timeout). As long as there is any delay in updates to the apps which we know there is it is impossible to make the lock work.

Imho, Jeff you are wasting your time.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 9:20pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/34 "2021-07-04T21:20:40Z")

</div>

no chance that you can double book my system! lol @Gary_Biagioni

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 9:21pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/35 "2021-07-04T21:21:32Z")

</div>

so i did it Jeff? thank you again for testing! @Jeff_Hager

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 9:26pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/36 "2021-07-04T21:26:28Z")

</div>

What happens if next week The delay changes to 6 seconds. Does it still work?

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 9:26pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/37 "2021-07-04T21:26:53Z")

</div>

why would it change? is me who setting a delay… i set it to 1 sec… and is good… as longer delay that better it is… but 1 sec work perfect

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 9:30pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/38 "2021-07-04T21:30:30Z")

</div>

It might be that I a I’m Timbuktu and they have crappy internet. It might be because there was some delay added in a server. It might be that the first requester has a 6 second delay and the the second one has 1 second delay.

If the solution requires a the delay to be less than a certain value it is not reliable.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [July 4, 2021, 9:31pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/39 "2021-07-04T21:31:31Z")

</div>

it dasnt matter… as long is longer than 1 sec

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [July 4, 2021, 9:31pm UTC](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593/40 "2021-07-04T21:31:45Z")

</div>

The delay that is important is the delay in updates from the server to the devices.

[Previous page](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593.md?page=1)

[Next page](https://community.glideapps.com/t/built-in-locking-or-semaphore-mechanism/28593.md?page=3)
