Index
2006-05-17 07:19Dave Crozier : Calvin adds more meat to multithreading
2006-05-17 07:25Tristan Leask : RE: Calvin adds more meat to multithreading
2006-05-17 08:38Dave Crozier : RE: Calvin adds more meat to multithreading
2006-05-17 08:40Dave Crozier : RE: Calvin adds more meat to multithreading
2006-05-17 16:25Mike Stewart : Re: Calvin adds more meat to multithreading
2006-05-17 16:39john harvey : RE: Calvin adds more meat to multithreading
2006-05-18 07:30Nick C : RE: Calvin adds more meat to multithreading
2006-05-18 07:38MB Software Solutions : Re: Calvin adds more meat to multithreading
2006-05-18 07:51Christof Wollenhaupt : RE: Calvin adds more meat to multithreading
2006-05-18 09:08Malcolm Greene : Re: Calvin adds more meat to multithreading
Back to top
Calvin adds more meat to multithreading

Author: Dave Crozier

Posted: 2006-05-17 07:19:13   Link

Calvin has added more "meat" to his article on multithreading with VFP:

http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

"Create multiple threads from within your application

When I posted this Sample program to create multiple threads

<http://blogs.msdn.com/calvin_hsia/archive/2006/05/11/595562.aspx> , I knew

the inevitable follow-up question was “can I run my VFP code in separate

threads?”. Sure enough, several people asked, citing various valid usage

scenarios.

Below is a class that you can use to run your VFP code in multiple separate

threads. It can create as many threads as you like, each of which is running

VFP code. Because it is a multithreaded sample, it requires the

multithreaded runtime, which is just a few megabytes."

Very good reading.

Dave Crozier

Evolution of the .NET programmer:

* 0 months to 1 month: complete beginner

* 1 month to 1 year: incomplete beginner

* 1 year to 2 years: adept

* 2 years to 3 years: expert

--

No virus found in this outgoing message.

Checked by AVG Free Edition.

Version: 7.1.392 / Virus Database: 268.6.0/341 - Release Date: 16/05/2006

©2006 Dave Crozier
Back to top
RE: Calvin adds more meat to multithreading

Author: Tristan Leask

Posted: 2006-05-17 07:25:39   Link

In the words of a drunken English man...

'stoooopendus'

Thanks for the link Dave!!

Tristan

-----Original Message-----

From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com]

On Behalf Of Dave Crozier

Posted At: 17 May 2006 13:19

Posted To: Profox Archive

Conversation: Calvin adds more meat to multithreading

Subject: Calvin adds more meat to multithreading

Calvin has added more "meat" to his article on multithreading with VFP:

http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

"Create multiple threads from within your application

When I posted this Sample program to create multiple threads

<http://blogs.msdn.com/calvin_hsia/archive/2006/05/11/595562.aspx> , I

knew

the inevitable follow-up question was "can I run my VFP code in separate

threads?". Sure enough, several people asked, citing various valid usage

scenarios.

Below is a class that you can use to run your VFP code in multiple

separate

threads. It can create as many threads as you like, each of which is

running

VFP code. Because it is a multithreaded sample, it requires the

multithreaded runtime, which is just a few megabytes."

Very good reading.

Dave Crozier

Evolution of the .NET programmer:

* 0 months to 1 month: complete beginner

* 1 month to 1 year: incomplete beginner

* 1 year to 2 years: adept

* 2 years to 3 years: expert

--

No virus found in this outgoing message.

Checked by AVG Free Edition.

Version: 7.1.392 / Virus Database: 268.6.0/341 - Release Date:

16/05/2006

[excessive quoting removed by server]

©2006 Tristan Leask
Back to top
RE: Calvin adds more meat to multithreading

Author: Dave Crozier

Posted: 2006-05-17 08:38:31   Link

Tristan,

You need to surround the line:

CloseHandle(this.hThreads[i])

With a try...catch...endtry or it barfs - he did say minimal error checking

though!

Dave Crozier

"If it weren't for C, we'd be writing programs in BASI, PASAL, and OBOL."

-----Original Message-----

From: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] On Behalf

Of Tristan Leask

Sent: 17 May 2006 13:26

To: profox@leafe.com

Subject: RE: Calvin adds more meat to multithreading

In the words of a drunken English man...

'stoooopendus'

Thanks for the link Dave!!

Tristan

-----Original Message-----

From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com]

On Behalf Of Dave Crozier

Posted At: 17 May 2006 13:19

Posted To: Profox Archive

Conversation: Calvin adds more meat to multithreading

Subject: Calvin adds more meat to multithreading

Calvin has added more "meat" to his article on multithreading with VFP:

http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

"Create multiple threads from within your application

When I posted this Sample program to create multiple threads

<http://blogs.msdn.com/calvin_hsia/archive/2006/05/11/595562.aspx> , I knew

the inevitable follow-up question was "can I run my VFP code in separate

threads?". Sure enough, several people asked, citing various valid usage

scenarios.

Below is a class that you can use to run your VFP code in multiple separate

threads. It can create as many threads as you like, each of which is running

VFP code. Because it is a multithreaded sample, it requires the

multithreaded runtime, which is just a few megabytes."

Very good reading.

Dave Crozier

Evolution of the .NET programmer:

* 0 months to 1 month: complete beginner

* 1 month to 1 year: incomplete beginner

* 1 year to 2 years: adept

* 2 years to 3 years: expert

--

No virus found in this outgoing message.

Checked by AVG Free Edition.

Version: 7.1.392 / Virus Database: 268.6.0/341 - Release Date:

16/05/2006

[excessive quoting removed by server]

©2006 Dave Crozier
Back to top
RE: Calvin adds more meat to multithreading

Author: Dave Crozier

Posted: 2006-05-17 08:40:09   Link

My Results

Multithreaded performance: 11.757 seconds

Single Threaded performance: 133.422 seconds

An impressive speed gain!

Dave Crozier

"If it weren't for C, we'd be writing programs in BASI, PASAL, and OBOL."

-----Original Message-----

From: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] On Behalf

Of Tristan Leask

Sent: 17 May 2006 13:26

To: profox@leafe.com

Subject: RE: Calvin adds more meat to multithreading

In the words of a drunken English man...

'stoooopendus'

Thanks for the link Dave!!

Tristan

-----Original Message-----

From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com]

On Behalf Of Dave Crozier

Posted At: 17 May 2006 13:19

Posted To: Profox Archive

Conversation: Calvin adds more meat to multithreading

Subject: Calvin adds more meat to multithreading

Calvin has added more "meat" to his article on multithreading with VFP:

http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

"Create multiple threads from within your application

When I posted this Sample program to create multiple threads

<http://blogs.msdn.com/calvin_hsia/archive/2006/05/11/595562.aspx> , I knew

the inevitable follow-up question was "can I run my VFP code in separate

threads?". Sure enough, several people asked, citing various valid usage

scenarios.

Below is a class that you can use to run your VFP code in multiple separate

threads. It can create as many threads as you like, each of which is running

VFP code. Because it is a multithreaded sample, it requires the

multithreaded runtime, which is just a few megabytes."

Very good reading.

Dave Crozier

Evolution of the .NET programmer:

* 0 months to 1 month: complete beginner

* 1 month to 1 year: incomplete beginner

* 1 year to 2 years: adept

* 2 years to 3 years: expert

--

No virus found in this outgoing message.

Checked by AVG Free Edition.

Version: 7.1.392 / Virus Database: 268.6.0/341 - Release Date:

16/05/2006

[excessive quoting removed by server]

©2006 Dave Crozier
Back to top
Re: Calvin adds more meat to multithreading

Author: Mike Stewart

Posted: 2006-05-17 16:25:37   Link

> Date: Wed, 17 May 2006 13:19:13 +0100

> From: "Dave Crozier" <DCrozier@Flexipol.co.uk>

> Subject: Calvin adds more meat to multithreading

> Calvin has added more "meat" to his article on multithreading with VFP:

>

> http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

If nothing else, it serves as a fine example of why you should

probably choose another tool/method for doing your multithreaded

programming. What a mess.

--

Mike Stewart

©2006 Mike Stewart
Back to top
RE: Calvin adds more meat to multithreading

Author: john harvey

Posted: 2006-05-17 16:39:17   Link

Calvin isn't very smart, is he? <G>

John

-----Original Message-----

From: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] On Behalf

Of Mike Stewart

Sent: Wednesday, May 17, 2006 4:26 PM

To: profox@leafe.com

Subject: Re: Calvin adds more meat to multithreading

> Date: Wed, 17 May 2006 13:19:13 +0100

> From: "Dave Crozier" <DCrozier@Flexipol.co.uk>

> Subject: Calvin adds more meat to multithreading

> Calvin has added more "meat" to his article on multithreading with VFP:

>

> http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

If nothing else, it serves as a fine example of why you should

probably choose another tool/method for doing your multithreaded

programming. What a mess.

--

Mike Stewart

[excessive quoting removed by server]

©2006 john harvey
Back to top
RE: Calvin adds more meat to multithreading

Author: Nick C

Posted: 2006-05-18 07:30:11   Link

>> Date: Wed, 17 May 2006 13:19:13 +0100

>> From: "Dave Crozier" <DCrozier@Flexipol.co.uk>

>> Subject: Calvin adds more meat to multithreading

>

>> Calvin has added more "meat" to his article on multithreading with VFP:

>>

>> http://blogs.msdn.com/calvin_hsia/archive/2006/05/16/599108.aspx

>

>If nothing else, it serves as a fine example of why you should

>probably choose another tool/method for doing your multithreaded

>programming. What a mess.

>

>--

>Mike Stewart

Don't you think that is a particularly destructive comment Mike!

At least Calvin is trying to assist the Fox community by finding ways to workaround problems that Microsoft seems unwilling to

solve. If Calvin can make Fox work multithreaded, albeit in a slightly convoluted way, surely we should question why Microsoft

hasn't built this facility natively into VFP?

Nick

©2006 Nick C
Back to top
Re: Calvin adds more meat to multithreading

Author: MB Software Solutions

Posted: 2006-05-18 07:38:02   Link

Nick C wrote:

>Don't you think that is a particularly destructive comment Mike!

>

>At least Calvin is trying to assist the Fox community by finding ways to workaround problems that Microsoft seems unwilling to

>solve. If Calvin can make Fox work multithreaded, albeit in a slightly convoluted way, surely we should question why Microsoft

>hasn't built this facility natively into VFP?

>

>

Hush up, Nick! Do you want M$ to get rid of Calvin? He's the secret

weapon on the VFP team! Now if they'd just let him have his way and

REALLY run with VFP! <g>

--

Michael J. Babcock, MCP

MB Software Solutions, LLC

http://mbsoftwaresolutions.com

http://fabmate.com

"Work smarter, not harder, with MBSS custom software solutions!"

©2006 MB Software Solutions
Back to top
RE: Calvin adds more meat to multithreading

Author: Christof Wollenhaupt

Posted: 2006-05-18 07:51:27   Link

Hi Nick,

> At least Calvin is trying to assist the Fox community by finding ways to

workaround problems

But there are solutions out there for years... Remus Rusanu has got a

utility that I first mentioned 2001 in a session about COM:

http://www.geocities.com/rremus/multithreaded_vfp.htm

Last year for my session about multi-threading and VFP I wrote a C DLL that

launches multiple threads. You can download all the session samples include

source code (in German) from my web site (DMULT.ZIP):

http://www.foxpert.com/downloads.htm

However, multi-threading in VFP is not the same as multi-threading in other

languages. In VFP you need an MTDLL with the code for the second thread.

That means you have a second runtime environment along with it's own set of

PUBLIC variables, tables, and the like. You can't move a long-running SELECT

statement into the background without using typical COM technologies like

XMLTOCURSOR(), external tables, etc.

--

Christof

©2006 Christof Wollenhaupt
Back to top
Re: Calvin adds more meat to multithreading

Author: Malcolm Greene

Posted: 2006-05-18 09:08:36   Link

Michael,

<snip>

Hush up, Nick! Do you want M$ to get rid of Calvin? He's the secret

weapon on the VFP team! Now if they'd just let him have his way and

REALLY run with VFP!

</snip>

<chant>

Let the fox out of his cage!

</chant>

Calvin's been posting some amazingly cool stuff. There's a VFP verion 10

trapped within Calvin and screaming to get out!

Malcolm

©2006 Malcolm Greene