Hi,

I've added this little function to my copy of vm\thread.c, I attach it here so
that Przemyslaw and/or Viktor can have a look at it and also because I'm not
at ease with branching and so I don't know where to commit this change.

-----------8<-----------------
HB_FUNC( HB_THREADID )
{
#if defined( HB_MT_VM )
   PHB_THREADSTATE pThread = ( PHB_THREADSTATE ) hb_vmThreadState();
   if( pThread )
      hb_retnl( pThread->th_id );
#endif
}
----------->8-----------------

I've added this function because I was still investigating a speed issue on my
pc and I've changed also tests\speedtst.prg so that it creates two threads
which do the work (instead of a single one).

Please note that my changes are just an ugly hack to make it work and see if
having a SMP kernel on a HT cpu gives any advantage when the work is splitted
between two cpus.

I attach the modified speedtst.prg to this message also, so that anybody can
have a look at it

Well, that said, total time went from 70 seconds to 59.9 :)

MT PIV 3.6GHZ HT, OS/2 SMP kernel

============================================================
 0 - total application time:                              59.87
total real time:                                     59.88


I,ve also noted that thread 1 has a threadid of 0 (zero) while the other
threads have the correct id, maybe this is a minor glitch to correct.

Best regards.

Maurilio.


PS. speedtst.log shows 60 seconds total time.

-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.



Attachment: speedtst.prg
Description: application/prg

Attachment: speedtst.log
Description: application/log

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

Reply via email to