Hi Przemek,
Il 09/12/2008 16.33, Przemyslaw Czerpak ha scritto:
It seems to me that SET() values are read before starting Threads, then
they are separated and not shared between threads.
So if I define some SETs before starting threads it works, but once they
are started all changes are ignored in thread.
It's correct. Each thread has its own independent SETs which are local to
this thread.
When new thread is created it inherits copy of all existing SET values
from parent thread. It's intentional so if one thread makes SET DELETE ON
or SET SOFTSEEK OFF or SET DATE FORMAT TO ... then it does not effects other
threads.
Anyhow in few cases SETs can be bound with global resources which are shared
between threads. F.e. if two thread uses the same GT window then _SET_COLOR
will effect both of them. The same is with _SET_TYPEAHEAD.
There are also two SETs added recently and _SET_HBOUTLOG and _SET_HBOUTLOGINFO
which for FM log copies recently set values to static buffer because they need
them after releasing all threads and SETs. In such recently set values for
above _SET_HBOUTLOG* SETs by any thread are used inside FM statistic module.
Thank you for your reply.
The problem is that I need that SET_BACKGORUNDTASKS has to be shared
between threads, this is because threads have to be stopped or activated
based on above set.
In my repository I have background tasks that in ST mode works well and
I can stop / restart using above set.
On the contrary I have implemented background tasks in MT mode using
your sample (plus some refinements) but once the thread is started I
cannot control flow using above set.
And as you state above, there are some sets that is useful to have shared.
So how can I share it ?
And another problem is about screen updates.
Once the thread is started too many screen updates are done in wrong
places also if all updates are guarded with Row()/Col() save and restore.
(I'm looking also to your reply to Mindagaus that I find interesting)
Best regards
Francesco
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour