Hello Przemek
Przemyslaw Czerpak-2 wrote: > > In Harbour all threads are executed on each available CPUs. > It's default behavior of most OS-es and Harbour does not make > anything to disable it and reduce scalability. I have no idea > how it's presented in windows task manager. > If you have multi CPU hardware then you can use test/speedtst.prg > linked in MT mode and executed with --thread=2 --scale parameters > to check the scalability factor. The test shows that Harbour is quite > well scaled. Much better then xbase++ which seems to keep factor close > to 1.0 what means that only 1 CPU is effectively used. > > > The second thing is code use sent which cannot be compiled and executed > by Harbour due to missing some functionality in XBASE++ THREAD class > emulation, missing SLEEP() function and unsupported method declaration > in class definition by: METHOD <mthName1> [, <mthNameN> ] > SLEEP() can be replaced by: > #xtranslate sleep( <n> ) => hb_idleSleep( <n> / 100 ) > (please verify in xbase++ doc the SLEEP() precision and if it's > millisecond use 1000 instead of 100). > I'll add support to METHOD <mthName1> [, <mthNameN> ] declaration to > hbclass.ch. Maybe it will make using xbase++ code in Harbour easier. > The modifications in THREAD class are little bit more complicated. > It's necessary to change default NEW() method or simply remove it > and add at least some basic support for restarting the thread if > ::interval is set. > This modification should be done in rtl/tthreadx.prg. I'll make them > in next commit but I would like to ask xbase++ users to make any other > deeper modifications in this class when they are necessary. I have never > used xbase++ and it's hard for me to replicate it's exact behavior. > After your latest commits, the Xbase++ MT code is working as is with Harbour. Compilation issue a warning at METHOD Programmer:execute | RETURN that Return statement returns nothing, with highest warning level. I could not make out what is the difference between Harbour and Xbase++ but the code seems to run as intended. Angel, can you pick-up differences. In task manager I can see threads used by this programs PID equals 13. I am amazed how distictly you can imagine the behavior of another compiler which you have never used, mind-boggling ability, my hats-off. Regards Pritpal Bedi -- View this message in context: http://www.nabble.com/MT---Xbase%2B%2B---A-Code-Snippet-tp23783523p23844834.html Sent from the Harbour - Dev mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
