Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13529 > unrolled thread

Mult thread.. sample and discussion please

Started byPhil McGuinness <sherlocksoftware@gmail.com>
First post2022-01-31 18:44 -0800
Last post2022-02-07 13:19 +0100
Articles 7 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Mult thread.. sample and discussion please Phil McGuinness <sherlocksoftware@gmail.com> - 2022-01-31 18:44 -0800
    Re: Mult thread.. sample and discussion please Jamal <nospam@example.com> - 2022-02-01 16:24 -0500
    Re: Mult thread.. sample and discussion please "Wolfgang Riedmann" <wriedmann@gmail.com> - 2022-02-02 07:24 +0100
      Re: Mult thread.. sample and discussion please Phil McGuinness <sherlocksoftware@gmail.com> - 2022-02-02 01:15 -0800
        Re: Mult thread.. sample and discussion please dlzc <dlzc1@cox.net> - 2022-02-02 06:22 -0800
        Re: Mult thread.. sample and discussion please "Wolfgang Riedmann" <wriedmann@gmail.com> - 2022-02-06 15:24 +0100
          Re: Mult thread.. sample and discussion please Franz Rachbauer <office@rachbauer.org> - 2022-02-07 13:19 +0100

#13529 — Mult thread.. sample and discussion please

FromPhil McGuinness <sherlocksoftware@gmail.com>
Date2022-01-31 18:44 -0800
SubjectMult thread.. sample and discussion please
Message-ID<b1cb965f-2b77-4471-9b50-e7935c58bb91n@googlegroups.com>
Have a VO GUI app runs lots of things via Dispatch..   but one of those things needs a good hour to run.  I do not want wait in current processes for this.. and happy to have background event running. Realise on single thread cannot get this to work.. it wants that length job to finish before moving on.

So CreateVOThread and have a function with the work to be done.  Thought start this and do other things and that thread will finish.. until needed again.

Can I do this with simple to CreateVOthread with the function and the main thread is processing again.   I did not see this.. and confused. 

Any help welcome

[toc] | [next] | [standalone]


#13530

FromJamal <nospam@example.com>
Date2022-02-01 16:24 -0500
Message-ID<stc8f0$1qar$1@gioia.aioe.org>
In reply to#13529
Never used VO Threads! Check out discussions at: 
https://groups.google.com/g/comp.lang.clipper.visual-objects/search?q=CreateVOthread%20

You may something helpful.

Jamal


On 1/31/2022 9:44 PM, Phil McGuinness wrote:
> Have a VO GUI app runs lots of things via Dispatch..   but one of those things needs a good hour to run.  I do not want wait in current processes for this.. and happy to have background event running. Realise on single thread cannot get this to work.. it wants that length job to finish before moving on.
> 
> So CreateVOThread and have a function with the work to be done.  Thought start this and do other things and that thread will finish.. until needed again.
> 
> Can I do this with simple to CreateVOthread with the function and the main thread is processing again.   I did not see this.. and confused.
> 
> Any help welcome

[toc] | [prev] | [next] | [standalone]


#13531

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2022-02-02 07:24 +0100
Message-ID<j5umckFb0tdU1@mid.individual.net>
In reply to#13529
Hi Phil,

as Jamal wrote: never use threads in VO.

You can use them in X#, but if you have longer operations it may be
better to move them to background Windows services on some dedicated
machine and run them when the VO application sets a flag in the
database or writes some flag file.

Wolfgang

Phil McGuinness wrote:

> Have a VO GUI app runs lots of things via Dispatch..   but one of
> those things needs a good hour to run.  I do not want wait in current
> processes for this.. and happy to have background event running.
> Realise on single thread cannot get this to work.. it wants that
> length job to finish before moving on.
> 
> So CreateVOThread and have a function with the work to be done.
> Thought start this and do other things and that thread will finish..
> until needed again.
> 
> Can I do this with simple to CreateVOthread with the function and the
> main thread is processing again.   I did not see this.. and confused.
> 
> Any help welcome




-- 

[toc] | [prev] | [next] | [standalone]


#13532

FromPhil McGuinness <sherlocksoftware@gmail.com>
Date2022-02-02 01:15 -0800
Message-ID<c90fe8f2-f4d3-47a9-8b39-9214c79cb1c3n@googlegroups.com>
In reply to#13531
Jamal,  Wolfgang

Have it working ut in crashes it seems randomly.
I am not sure is DBServer thread safe.
I simply want a subset of data, open as DBSERVER and do some slow process to REST service.
The crash seems relate totally to a field in Dbserver.

With CreateVOThread is the a requirement to lock memory in a certain way.
Could not find many samples.

Did not want to write another whole service when my system is a Service.
Have not got that far... it crashes in the IDE.

Anybody elese experiences, pointers, gotta yas and frustrations.
Little clues help

Phil

[toc] | [prev] | [next] | [standalone]


#13533

Fromdlzc <dlzc1@cox.net>
Date2022-02-02 06:22 -0800
Message-ID<2dacebdc-eb85-41a5-8cae-898075fd3c97n@googlegroups.com>
In reply to#13532
Dear Phil McGuinness:

On Wednesday, February 2, 2022 at 2:15:46 AM UTC-7, Phil McGuinness wrote:
> Jamal, Wolfgang 
> 
> Have it working [but it] crashes it seems randomly.  I am not sure is
> DBServer thread safe.  I simply want a subset of data, open as
> DBSERVER and do some  slow process to REST service. 
> The crash seems relate totally to a field in Dbserver. 

Imagine a "blind" "vanilla" VO application, that looks for an "instruction file" in its working directory, renames it to an "in process" name (assuming it gets to, file is not locked or still being written to), does what is in the instruction file, and then renames it to a "completed" name.  It can be run at startup of the machine, as others have suggested.

VO is "free and easy" with stacks, and creating and freeing memory within its domain.  So you are NOT going to have success, unless you change how you code to prevent it doing this, possibly even accessing data files will be impossible, as a "thread".  Let it run as a standalone.

You can check status on assigned tasks, by checking the file names, and dates.

David A. Smith (not a VO programmer, but an earlier sister programmer)

[toc] | [prev] | [next] | [standalone]


#13534

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2022-02-06 15:24 +0100
Message-ID<j6a40tFp9eU1@mid.individual.net>
In reply to#13532
Hi Phil,

the VO development team has confirmed several times that the VO garbage
collector is not thread safe.

So, if you use threads, you cannot use dynamically allocated variables
like strings and objects.

The only possibility I see for you is to migrate to X#. Robert has done
miracles to make the runtime thread safe, and there every thread has
its own runtime state with its own settings.
So your main thread can have SetDeleted set to on, and one of your 
spawned threads can have set it to off. Even the workarea numbers are
per thread.

I can confirm you that the DBServer class in X# is thread safe as I use
it in WPF applications, and they need to be multithreaded to have a
responsive GUI.

Wolfgang


Phil McGuinness wrote:

> Jamal,  Wolfgang
> 
> Have it working ut in crashes it seems randomly.
> I am not sure is DBServer thread safe.
> I simply want a subset of data, open as DBSERVER and do some slow
> process to REST service.  The crash seems relate totally to a field
> in Dbserver.
> 
> With CreateVOThread is the a requirement to lock memory in a certain
> way.  Could not find many samples.
> 
> Did not want to write another whole service when my system is a
> Service.  Have not got that far... it crashes in the IDE.
> 
> Anybody elese experiences, pointers, gotta yas and frustrations.
> Little clues help
> 
> Phil



-- 

[toc] | [prev] | [next] | [standalone]


#13535

FromFranz Rachbauer <office@rachbauer.org>
Date2022-02-07 13:19 +0100
Message-ID<str2oi$3pu$1@gioia.aioe.org>
In reply to#13534
Why not do this thread in a sep app running on taskbar or in a service?
Regards, Franz

Am 06.02.2022 um 15:24 schrieb Wolfgang Riedmann:
> Hi Phil,
> 
> the VO development team has confirmed several times that the VO garbage
> collector is not thread safe.
> 
> So, if you use threads, you cannot use dynamically allocated variables
> like strings and objects.
> 
> The only possibility I see for you is to migrate to X#. Robert has done
> miracles to make the runtime thread safe, and there every thread has
> its own runtime state with its own settings.
> So your main thread can have SetDeleted set to on, and one of your
> spawned threads can have set it to off. Even the workarea numbers are
> per thread.
> 
> I can confirm you that the DBServer class in X# is thread safe as I use
> it in WPF applications, and they need to be multithreaded to have a
> responsive GUI.
> 
> Wolfgang
> 
> 
> Phil McGuinness wrote:
> 
>> Jamal,  Wolfgang
>>
>> Have it working ut in crashes it seems randomly.
>> I am not sure is DBServer thread safe.
>> I simply want a subset of data, open as DBSERVER and do some slow
>> process to REST service.  The crash seems relate totally to a field
>> in Dbserver.
>>
>> With CreateVOThread is the a requirement to lock memory in a certain
>> way.  Could not find many samples.
>>
>> Did not want to write another whole service when my system is a
>> Service.  Have not got that far... it crashes in the IDE.
>>
>> Anybody elese experiences, pointers, gotta yas and frustrations.
>> Little clues help
>>
>> Phil
> 
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web