Hi Viktor,

ok I read (thank you for reposting in explicit way to Przemek), so I will do some tests and propose a solution.

Best Regards,
Francesco

Il 16/07/2009 14.34, Viktor Szakáts ha scritto:
Okay thank you, I understand now.

For ST mode background tasks we should then resort to the HB_IDLE*()
API I guess (Note to Francesco).

Brgds,
Viktor

On 2009.07.16., at 2:13, Przemyslaw Czerpak wrote:

On Thu, 16 Jul 2009, Szak�ts Viktor wrote:

Hi,

Do you think it's possible to enable emulated MT in ST
hbvm lib?

With the cost of speed.
Harbour tasks reduce HVM speed in comparable way to OS threads.
It's caused by different HVM stack representation. In ST mode
it's static variable and compiler can optimize access to it.
In MT (native or emulated) it's access indirectly by pointer
so less efficient code is generated.

This would equalize the features across MT and non-MT VM.
Which means users could have these features in all
Harbour apps and could further decide if they need true
MT with some performance hit or emulated MT with no speed
degradation.
I'd think emulated MT could be useful for a lot of regular
apps which don't need true MT.
What do you think?

See above. Internal HVM code is different for Harbour tasks.
It's exactly the same as for native threads.
The difference between Harbour tasks and native threads is only
in task switching which is done not by OS but by our own code
in well known places so we do not have to worry about non reentrant
safe OS or CRTL code.
You cannot use ST HVM with native threads or Harbour tasks because
its internal structures does not allow such usage. Of course in
theory it's possible to safe and restore all ST HVM states when
tasks are switched but in practice it will be hard to implement
and then keep it working updating all places which may store context
information. And of course it will kill the performance due to cost
of such task switching

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

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

Reply via email to