BTW, now it's be possible to implement background
processes (in xhb lib) using MT, since it's available
on all platforms :)
Brgds,
Viktor
On 2009.07.03., at 18:24, Teo Fonrouge wrote:
On 03/07/2009, at 01:29 a.m., dru...@users.sourceforge.net wrote:
Revision: 11614
http://harbour-project.svn.sourceforge.net/harbour-project/?rev=11614&view=rev
Author: druzus
Date: 2009-07-03 06:29:26 +0000 (Fri, 03 Jul 2009)
Log Message:
-----------
2009-07-03 08:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/include/hbtask.h
+ harbour/source/vm/task.c
* harbour/include/hbthread.h
* harbour/include/hbatomic.h
* harbour/source/vm/thread.c
* harbour/source/vm/hvm.c
* harbour/source/vm/fm.c
* harbour/source/rtl/idle.c
* harbour/source/rtl/filesys.c
+ implemented OS independent task switching system - it gives
PTHREAD
compatible basic API so it can be used in HVM as alternative
MT support
which does not use any OS threads. As long as Harbour does not
call
any blocking OS function then it's possible to create and
execute
simultaneously many threads though only one CPU is used and
switched
between HVM threads. It gives similar scalability to xbase++
threads
and also similar behavior in item protection at .prg level.
Now it's possible to use HVM threads in any OS.
Of course it does not mean that Harbour adds in some magic way
thread support to OS-es which does not support threads like DOS.
It only means that HVM supports threads for .prg code just like
in native MT environment as long as some C code does not block
task switching or process execution will not be frozen by sth,
i.e.
executing other process (__run()) in single process OS like DOS.
In some cases it can be interesting alternative even in OS which
have native thread support.
Hello Przemek,
Thank you for this excellent feature.
To report you, that I successfully converted a OS threaded GUI
program (which needs to open a new OS/thread for each new socket
connection that arrives and refresh a set of GUI controls) to use
just your new HVM Threads feature.
It works well, and now I have not to use the library functions to
mutex the GUI library each time that the controls need to be
refreshen (in my case for wxWidgets are wxMutexGuiEnter/
wxMutexGuiLeave).
[snip]
Thank you again for gift us with new toys now in for the future
ones :)
best regards,
Teo
_______________________________________________
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