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


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

Multi threading a few more questions

Started byMartin <spam@spam.spam>
First post2013-04-24 14:28 +0100
Last post2013-04-24 16:18 +0100
Articles 8 — 3 participants

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


Contents

  Multi threading a few more questions Martin <spam@spam.spam> - 2013-04-24 14:28 +0100
    Re: Multi threading a few more questions "Ginny Caughey" <gcaughey@online.hotmail.com> - 2013-04-24 10:32 -0400
      Re: Multi threading a few more questions Martin <spam@spam.spam> - 2013-04-24 16:18 +0100
        Re: Multi threading a few more questions "Ginny Caughey" <gcaughey@online.hotmail.com> - 2013-04-24 18:29 -0400
          Re: Multi threading a few more questions Martin <spam@spam.spam> - 2013-04-26 10:10 +0100
            Re: Multi threading a few more questions dlzc <dlzc1@cox.net> - 2013-04-26 07:34 -0700
              Re: Multi threading a few more questions Martin <spam@spam.spam> - 2013-04-26 16:25 +0100
      Re: Multi threading a few more questions Martin <spam@spam.spam> - 2013-04-24 16:18 +0100

#5140 — Multi threading a few more questions

FromMartin <spam@spam.spam>
Date2013-04-24 14:28 +0100
SubjectMulti threading a few more questions
Message-ID<w5Rdt.114261$Pj4.60689@fx14.fr7>
I have written the framework for a processing engine, it will use a 
couple of threads to do alternate data access while the main application 
is busy. A test calling a simple set did 2600 (first I saw after 5000 
lines in my log file) calls before I quitted the program.

The idea works perfectly well in the more simpler predecessor written in 
Xbase++.

I will kick off a thread, it will do its check while the rest of the 
system carries on its work, then return when finished.

While running it will need to access about 10 DBFs via ADS, take a 
couple of seconds to access it and decide on an answer, then if OK tell 
the user via a loudspeaker that what they are loading is full.

So there is a risk of the garbage collector kicking in on the thread, is 
this dangerous?

Thanks

Martin

[toc] | [next] | [standalone]


#5142

From"Ginny Caughey" <gcaughey@online.hotmail.com>
Date2013-04-24 10:32 -0400
Message-ID<5177ecfb$0$63280$c3e8da3$3a1a2348@news.astraweb.com>
In reply to#5140
You might be able to get away with this if none of your data types are 
garbage collectible (no strings, usuals, etc.) and if you use separate 
workareas in each thread for accessing the DBF files. I don't recommend it 
but I have used this approach successfully many years ago. Today I'd just 
use a separate app that could be kicked off by the main app. Why is this not 
a possibility for you?

Ginny

"Martin"  wrote in message news:w5Rdt.114261$Pj4.60689@fx14.fr7...

I have written the framework for a processing engine, it will use a
couple of threads to do alternate data access while the main application
is busy. A test calling a simple set did 2600 (first I saw after 5000
lines in my log file) calls before I quitted the program.

The idea works perfectly well in the more simpler predecessor written in
Xbase++.

I will kick off a thread, it will do its check while the rest of the
system carries on its work, then return when finished.

While running it will need to access about 10 DBFs via ADS, take a
couple of seconds to access it and decide on an answer, then if OK tell
the user via a loudspeaker that what they are loading is full.

So there is a risk of the garbage collector kicking in on the thread, is
this dangerous?

Thanks

Martin 

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


#5143

FromMartin <spam@spam.spam>
Date2013-04-24 16:18 +0100
Message-ID<EISdt.7907$Ra4.1541@fx19.fr7>
In reply to#5142
Separate workareas - I am careful about that

The current system is a single executable, I am just changing dialect to 
one with an IDE and strict typing as well as a few thousand lines of 
code I want to use, the older application was my first working windows 
program, and was literally a recompile of Clipper with a GUI bolted on, 
multi threading added on more recently, I will do a collectforced before 
starting the thread and after clearing it.

The Alaska version used 4 or 5 strings, and an array.

It is pretty hard coding a window without an IDE!

Separate .exes looks messy on the screen and feels more like a bodge.

BTW I am using your serial class as an instruction aid for multi thread 
design.


On 24/04/2013 15:32, Ginny Caughey wrote:
> You might be able to get away with this if none of your data types are
> garbage collectible (no strings, usuals, etc.) and if you use separate
> workareas in each thread for accessing the DBF files. I don't recommend
> it but I have used this approach successfully many years ago. Today I'd
> just use a separate app that could be kicked off by the main app. Why is
> this not a possibility for you?
>
> Ginny
>
> "Martin"  wrote in message news:w5Rdt.114261$Pj4.60689@fx14.fr7...
>
> I have written the framework for a processing engine, it will use a
> couple of threads to do alternate data access while the main application
> is busy. A test calling a simple set did 2600 (first I saw after 5000
> lines in my log file) calls before I quitted the program.
>
> The idea works perfectly well in the more simpler predecessor written in
> Xbase++.
>
> I will kick off a thread, it will do its check while the rest of the
> system carries on its work, then return when finished.
>
> While running it will need to access about 10 DBFs via ADS, take a
> couple of seconds to access it and decide on an answer, then if OK tell
> the user via a loudspeaker that what they are loading is full.
>
> So there is a risk of the garbage collector kicking in on the thread, is
> this dangerous?
>
> Thanks
>
> Martin

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


#5148

From"Ginny Caughey" <gcaughey@online.hotmail.com>
Date2013-04-24 18:29 -0400
Message-ID<51785cb6$0$63676$c3e8da3$14a0410e@news.astraweb.com>
In reply to#5143
Good to hear the serial class is helpful. I still use it in production 
today.

Ginny

"Martin"  wrote in message news:EISdt.7907$Ra4.1541@fx19.fr7...

Separate workareas - I am careful about that

The current system is a single executable, I am just changing dialect to
one with an IDE and strict typing as well as a few thousand lines of
code I want to use, the older application was my first working windows
program, and was literally a recompile of Clipper with a GUI bolted on,
multi threading added on more recently, I will do a collectforced before
starting the thread and after clearing it.

The Alaska version used 4 or 5 strings, and an array.

It is pretty hard coding a window without an IDE!

Separate .exes looks messy on the screen and feels more like a bodge.

BTW I am using your serial class as an instruction aid for multi thread
design.


On 24/04/2013 15:32, Ginny Caughey wrote:
> You might be able to get away with this if none of your data types are
> garbage collectible (no strings, usuals, etc.) and if you use separate
> workareas in each thread for accessing the DBF files. I don't recommend
> it but I have used this approach successfully many years ago. Today I'd
> just use a separate app that could be kicked off by the main app. Why is
> this not a possibility for you?
>
> Ginny
>
> "Martin"  wrote in message news:w5Rdt.114261$Pj4.60689@fx14.fr7...
>
> I have written the framework for a processing engine, it will use a
> couple of threads to do alternate data access while the main application
> is busy. A test calling a simple set did 2600 (first I saw after 5000
> lines in my log file) calls before I quitted the program.
>
> The idea works perfectly well in the more simpler predecessor written in
> Xbase++.
>
> I will kick off a thread, it will do its check while the rest of the
> system carries on its work, then return when finished.
>
> While running it will need to access about 10 DBFs via ADS, take a
> couple of seconds to access it and decide on an answer, then if OK tell
> the user via a loudspeaker that what they are loading is full.
>
> So there is a risk of the garbage collector kicking in on the thread, is
> this dangerous?
>
> Thanks
>
> Martin 

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


#5156

FromMartin <spam@spam.spam>
Date2013-04-26 10:10 +0100
Message-ID<2wret.76596$9T.45281@fx22.fr7>
In reply to#5148
Well I have just had a big problem dropped on me

CSocket lib for Xbase++ is rather expensive, so I have even more coding 
to do, the scanner will now need to be in VO as well, and I will need to 
use your serial lib.

I want to use it on a SLE with CRLF ending each barcode, then pass the 
data out.

We will have a few (1 to 5 scanners) sitting there monitoring their 
barcode readers, sending data via a DBF, they will use a csocket to wake 
up the processor, if the processor is handling a loading process, it 
will kick off a thread to monitor the loading and then play a WAV saying 
loading complete. Done this as a single .exe with Xbase but I need to 
add a lot of code from VO hence the rewrite.

Thanks

Martin

On 24/04/2013 23:29, Ginny Caughey wrote:
> Good to hear the serial class is helpful. I still use it in production
> today.
>
> Ginny
>
> "Martin"  wrote in message news:EISdt.7907$Ra4.1541@fx19.fr7...
>
> Separate workareas - I am careful about that
>
> The current system is a single executable, I am just changing dialect to
> one with an IDE and strict typing as well as a few thousand lines of
> code I want to use, the older application was my first working windows
> program, and was literally a recompile of Clipper with a GUI bolted on,
> multi threading added on more recently, I will do a collectforced before
> starting the thread and after clearing it.
>
> The Alaska version used 4 or 5 strings, and an array.
>
> It is pretty hard coding a window without an IDE!
>
> Separate .exes looks messy on the screen and feels more like a bodge.
>
> BTW I am using your serial class as an instruction aid for multi thread
> design.
>
>
> On 24/04/2013 15:32, Ginny Caughey wrote:
>> You might be able to get away with this if none of your data types are
>> garbage collectible (no strings, usuals, etc.) and if you use separate
>> workareas in each thread for accessing the DBF files. I don't recommend
>> it but I have used this approach successfully many years ago. Today I'd
>> just use a separate app that could be kicked off by the main app. Why is
>> this not a possibility for you?
>>
>> Ginny
>>
>> "Martin"  wrote in message news:w5Rdt.114261$Pj4.60689@fx14.fr7...
>>
>> I have written the framework for a processing engine, it will use a
>> couple of threads to do alternate data access while the main application
>> is busy. A test calling a simple set did 2600 (first I saw after 5000
>> lines in my log file) calls before I quitted the program.
>>
>> The idea works perfectly well in the more simpler predecessor written in
>> Xbase++.
>>
>> I will kick off a thread, it will do its check while the rest of the
>> system carries on its work, then return when finished.
>>
>> While running it will need to access about 10 DBFs via ADS, take a
>> couple of seconds to access it and decide on an answer, then if OK tell
>> the user via a loudspeaker that what they are loading is full.
>>
>> So there is a risk of the garbage collector kicking in on the thread, is
>> this dangerous?
>>
>> Thanks
>>
>> Martin
>

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


#5157

Fromdlzc <dlzc1@cox.net>
Date2013-04-26 07:34 -0700
Message-ID<0e6734b6-0169-4516-a7a3-8501cd11a5ff@googlegroups.com>
In reply to#5156
Dear Martin:

On Friday, April 26, 2013 2:10:37 AM UTC-7, Martin wrote:
> Well I have just had a big problem dropped on me
> 
> CSocket lib for Xbase++ is rather expensive, so I
> have even more coding to do, the scanner will now
> need to be in VO as well, and I will need to 
> use your serial lib.

So, your time is free?  Isn't your time "rather expensive" too?  If not, why not?

David A. Smith

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


#5158

FromMartin <spam@spam.spam>
Date2013-04-26 16:25 +0100
Message-ID<w%wet.160752$ui1.13245@fx02.fr7>
In reply to#5157
My time may be cheaper in the long run as VO will do the job anyway

On 26/04/2013 15:34, dlzc wrote:
> Dear Martin:
>
> On Friday, April 26, 2013 2:10:37 AM UTC-7, Martin wrote:
>> Well I have just had a big problem dropped on me
>>
>> CSocket lib for Xbase++ is rather expensive, so I
>> have even more coding to do, the scanner will now
>> need to be in VO as well, and I will need to
>> use your serial lib.
>
> So, your time is free?  Isn't your time "rather expensive" too?  If not, why not?
>
> David A. Smith
>

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


#5144

FromMartin <spam@spam.spam>
Date2013-04-24 16:18 +0100
Message-ID<1JSdt.7908$Ra4.7592@fx19.fr7>
In reply to#5142
BTW hit send before saying thankyou!

On 24/04/2013 15:32, Ginny Caughey wrote:
> You might be able to get away with this if none of your data types are
> garbage collectible (no strings, usuals, etc.) and if you use separate
> workareas in each thread for accessing the DBF files. I don't recommend
> it but I have used this approach successfully many years ago. Today I'd
> just use a separate app that could be kicked off by the main app. Why is
> this not a possibility for you?
>
> Ginny
>
> "Martin"  wrote in message news:w5Rdt.114261$Pj4.60689@fx14.fr7...
>
> I have written the framework for a processing engine, it will use a
> couple of threads to do alternate data access while the main application
> is busy. A test calling a simple set did 2600 (first I saw after 5000
> lines in my log file) calls before I quitted the program.
>
> The idea works perfectly well in the more simpler predecessor written in
> Xbase++.
>
> I will kick off a thread, it will do its check while the rest of the
> system carries on its work, then return when finished.
>
> While running it will need to access about 10 DBFs via ADS, take a
> couple of seconds to access it and decide on an answer, then if OK tell
> the user via a loudspeaker that what they are loading is full.
>
> So there is a risk of the garbage collector kicking in on the thread, is
> this dangerous?
>
> Thanks
>
> Martin

[toc] | [prev] | [standalone]


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


csiph-web