> I’m not sure I agree that the ONLY 4D command in the language that is
atomic is “Semaphore”.
> I’m guessing there are others. Gonna need a 4D engineer like Laurent
Esnault that knows the
> deep internals of 4D’s code to know for sure.

For what it's worth, I was working at 4D in Cupertino when 4D Server
shipped. We had big arguments in the US office about IP communications and
semaphores. (Most people really don't love semaphores.) Semaphores turned
out to be the one and only reliable mechanism available. Unless something
has changed, that's still going to be true.

I'm sure there are a narrow set of cases where not using semaphores to lock
a shared read-write resource won't cause any harm. It's easy to come up
with cases and I'd bet we all have some of each. Say you have an IP
variable like <>TAB and you assign in Char(13) more than once. No harm. But
for groups of arrays (or even single arrays), it's pretty much not save to
read or write without a lock unless the arrays are static. And it's
*totally* normal to have a static array. Initialize it once at startup (or
on first use) and that's it. No modifications, just lookups. No elements
change position or value, the array never changes size. (Some languages
have a construct for this type of list, we just have arrays and how we use
them.)  No need for a semaphore there either.

I guess the rule is: If you think that you might need a semaphore lock, you
do ;-)
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to