Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record lock issue
Message
From
29/08/2008 18:54:45
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01342876
Message ID:
01343417
Views:
44
>>
>>Thank you this is a good point.
>>I do want to limit to “x” users using the system simultaneously. I like your idea of using LOCATE for RLOCK(), and I guess I could do that and if all records are locked I would have to check for record count and decide if I will allow to add another record for a new user or deny them a connection, but now the code losing its beauty again. For now I have to figure out the RLOCK() problem.
>
>Yelena,
>
>Have you considered using a method of semaphore file locks instead of RLOCK() for limiting users? In my application where I need to lock in or out users I use this method. I think it is more reliable than RLOCK(). You can create a bunch of semaphore files like simple empty text files FILE1, FILE2, and so on. Then when a user enters the application one of the semaphore files is locked (using FOPEN() function). When a user cannot find a semaphore file to lock, they have to wait.
>
>HTH

Dima,
Yes I did actually something similar to what you are suggesting, but when I got customers with 30 plus users the process become unacceptably slow.
If you are interested I can post a snippet of my code where I did that, maybe I was using inefficient logic.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform