I've finally tracked down a weird problem. I have some code that I'm
(still) trying to run in a worker. I've got the system set up so that I can
launch in cooperative or preemptive mode based on a setting. This way, if
there's a problem with preemptive mode, we can tweak a config setting and
try again in cooperative mode.

This is all working in tests.

But my overall system was failing to deliver in preemptive mode. The
preemptive worker launches just fine...by my subsequent calls to the work
fail, but only in preemptive (multi-thread/multi-core) mode.

I've got an ON ERR CALL installed that's thread-safe...but it never fires.

I think this is part of a bug I reported months ago regarding passing
non-thread safe code to a thread-safe worker. The compiler tries to stop us
from *compiling* such code, but the compiled mode runtime interpreter does
not. You can pass anything into a worker, even unsafe code. The exact
results at that point are....undefined. I think that Thomas Maul said on
the forums that getting ON ERR working reliably in this situation would be
done. (I'm in R3, maybe it has been done.)

Anyway, the warning is this: You have to take extra steps to vet your code
because *the compiler does not inspect the statements that you submit
through CALL WORKER.* I think it's recently started testing that ON ERR
CALL methods exist in one situation, but that's the first and only time I'm
aware of that 4D sees arguments to EXECUTE (under whatever name) as
anything bug raw strings.

So, lesson relearned.

Anyway, what you need to do is look through your code and see any that
might be Unclean. The compiler is said to be able to dump out this
attribute for all methods. The other way is to create a method that is
marked to run in preemptive mode and then put calls to your other methods
in there. In this case, the compiler will flag any that are unsafe for you.

Kind of a hassle, but there it is.
**********************************************************************
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