Continuing my research, I thought that I should check how GET PROCESS
VARIABLE interacts with workers. Fear not, my hatred of this command and
its brethren remains fierce, hot and pure. I took a look at Laurent
Esnault's lucid presentation on mutli-threaded code from the Portland
Summit and nothing seems to have changed since then. I can only add a few
details not found in there. Here's a summary:

* GET PROCESS VARIABLE works normally when you have a cooperative worker.

* GET PROCESS VARIABLE returns nothing from a preemptive worker.

That all makes sense. It would be a bit nuts to make preemptive threads
have to spend a lot of time checking for inbound requests for data. (You
need an interrupt.) It makes sense to avoid all of that and restrict
preemptive workers to discrete tasks. I'm so much in favor of this idea, I
even asked for it as a feature request:

Protect process variables inside of workers
http://forums.4d.fr/Post/EN/19111663/1/19111664

Yeah, well, I got no love from other developers there. John DeSoi also
privately explained a case he has where it makes a lot of sense to use GET
PROCESS VARIABLE. It tastes like bitter ash in my mouth, but I had to agree
that the existing feature set didn't give him a better option.

Anyway, I never use those commands so I don't care much about how they
work, but I did want to check that a GET PROCESS VARIABLE call to a
preemptive worker wouldn't blow it up the way a bit of cooperative code
executed remotely via CALL WORKER does. That would really suck. But it
doesn't work that way, 4D thought this through.

But as a heads up to those of you who do use The Evil Commands, I figured
you might want to know that they *fail silently* with a call to preemptive
process. So. Now you know.
**********************************************************************
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:[email protected]
**********************************************************************

Reply via email to