Hi Przemek,

  2. DEBUGGER is not MT safe. Now do not use debugger in code with
     more then one thread active or it will crash.
Before we will touch this code please think how MT debugger should
     work.

I've run into this be accident just yesterday. I've
compiled my app with -b (partially, then fully) and
used HB_BUILD_DEBUG=yes, which enabled debug mode in
MSVC, and resulting app was crashing probably in an
hb_x*() function, in a hb_gc*() function with an
RTE saying the "Object Destructor Failure". I'll
rephrase this error, because it sounds like something
OOP related, while it's not. (should be "Memory object
destructor failure")

To make things more complicated, this happened
in 64-bit mode, right on startup, and in one of
my .c functions (IniLoad()). The app is not using
multiple threads. This .c function looks safe, and
uses a pair of hb_xgrab()/hb_retclen_buffer() calls.
BTW, Harbour was compiled with -DHB_NO_DEBUG, and
-DHB_FM_STATISTICS_OFF.

When I turned off debugging, the problem went away.

If you want, I can redo some tests to make the
circumstances cleaner.

TODO:
  1. We should check contrib code and eliminate non MT safe code
     or document non MT safe functions.
  2. Possible TODO: make RDD settings (rddInfo()) thread local.
     Should we make it?

IMO, it should be global. But I couldn't find
any detailed documentation on this function. We have
to take into account though, that some externally
dependent RDDs may not support multiple configurations per
thread, also I'd think this would lead to chaos
in real life, and overkill flexibility and source
of bad problems.

  3. Thread priorities - is it really necessary?

IMO, it would be useful. No real life personal need
yet from my side, but I could imagine using IDLE
initially, and maybe even more levels for a server-side
app.

Brgds,
Viktor

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to