PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → is HyperFile thread safe ?
is HyperFile thread safe ?
Iniciado por vvido, 17,dic. 2015 11:11 - 4 respuestas
Miembro registrado
94 mensajes
Publicado el 17,diciembre 2015 - 11:11
I have several processes which work on hyperFile data.
This processes work on same files, but on different records.
But they use several hyperfile functions, HFilter for example.

Does each thread have a private context, or do I have to set some setting ?
Miembro registrado
94 mensajes
Publicado el 17,diciembre 2015 - 11:19
Just a short addition to the question - I do understand, that threads have isolated hFile contexts.

But if I start several MDI windows, does each window have isolated hyperFile context ?
Publicado el 17,diciembre 2015 - 14:38
Hi

it's a setting/choice in the window options

Best regards


--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

A votre disposition : WXShowroom.com, WXReplication (open source) et
maintenant WXEDM (open source)

Plus d'information sur http://fabriceharari.com


On 12/17/2015 5:19 AM, vvido wrote:
Just a short addition to the question - I do understand, that threads
have isolated hFile contexts.
But if I start several MDI windows, does each window have isolated
hyperFile context ?
Miembro registrado
94 mensajes
Publicado el 17,diciembre 2015 - 16:35
cool, found it, thanks.

I have a main menu as MDI parent.
This menu calls MDI child windows. They are all tables/loopers.
They are marked as MDI Child and have 'independent HFSQL content' checked now.

The windows which are called by these tables are forms which change the data shown in the tables. They share data with the tables.
To my understanding they should NOT have 'independent HFSQL content' checked because they inherit the context from the window (table)
which calls them.
Am I correct ?

What is the best practice to avoid problems in such cases (classic MDI application)

- start threads from the main menu
OR
- calling OpenChild and taking care of checkbox 'independent HFSQL content' for the windows opend by OpenChild ?
Publicado el 17,diciembre 2015 - 19:46
Hi

they can have independent context if you desing your application that way.

If you are using the RAD, you are on your own.

If not, you can just pass the record ID as a parameter and work inside
an independent context (or not, once again, as it depends of what you
want to do and how you code it)

By example, independent HF context is not useful if:
- you pass the ID of the record
- read the record in your secondary window
- when/if you want to save it, read it again, compare current values
with original once, change only the fields that need changing, and save

As I was saying, it's all in your code :-)

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


On 12/17/2015 10:35 AM, vvido wrote:
cool, found it, thanks.

I have a main menu as MDI parent.
This menu calls MDI child windows. They are all tables/loopers.
They are marked as MDI Child and have 'independent HFSQL content'
checked now.

The windows which are called by these tables are forms which change the
data shown in the tables. They share data with the tables.
To my understanding they should NOT have 'independent HFSQL content'
checked because they inherit the context from the window (table)
which calls them. Am I correct ?

What is the best practice to avoid problems in such cases (classic MDI
application)

- start threads from the main menu OR - calling OpenChild
and taking care of checkbox 'independent HFSQL content' for the windows
opend by OpenChild ?