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 [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
