Hi Francesco,

> I have a background tasks version that works in ST (using my original work,
> that is what you have ported also if I didn't already check it) and an MT
> version that uses threads but using same syntax of ST mode.
> But to make it working from xhb lib there is needs to have some code that
> permits to inject code inside VM, either inside hb_vmExecute() than in
> hb_vmQuit(), from an external lib or, as I did, having defines that isolate
> code using a HB_BACKGROUND_TASKS define so you can decide to add background
> tasks code or not using hbsetup.ch. Last version I adopted in my local
> repository.

I'd prefer something which doesn't need any "background task"
specific code inside our VM, not even with macro protection as
it will create another build time switch, which I'd try to avoid,
especially if it targets non-core features.

> In my code I use some defines and, in particular, HB_MT_VM to alter code
> behavior. The only problem I found is that at PRG level HB_MT_VM is not
> defined so I changed make system to define it also at PRG level.

hb_mtvm() function call is safe to use on the .prg level. With
#define it cannot work properly, as ST/MT selection is done at
link time, not compile time.

> All above I did in an old repository that is not updated to current SVN so
> it is possible that now the behavior is different. I have to check it.
> Tell me if it can interest.

Yes of course, but we need to find a solution to "inject" it in core
in ST mode and do so in a generic way (through core API calls).
Maybe as inkey idle events, I'm not sure if we have them in Harbour,
but background events was solved using them in Clipper.

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

Reply via email to