Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who uses Chen's product?
Message
From
25/07/2019 12:03:06
 
 
To
23/07/2019 20:09:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01663044
Message ID:
01669743
Views:
113
>>>>But I'm quite happy to use the 64-bit version for my pet projects. It's so much faster and stable.
>>>
>>>I didn't use it and this is more of a question. 64 or 32 bits, is it still using Single Threaded Apartment model? Can you check the CPU core loads while running a sample please.
>>
>>No clue and no sample code at hand. I tried to load it again, but 2nd time it's just too fast. The cpu usage showed activity on both cores (my VM doesn't use more than that), but that much that was on the 2nd core could have been caused by the OS (opening files, creating tmp files, loading icons etc), ergo inconclusive.
>>
>>>PS: Maybe it wouldn't give an idea that way, if the code explicitly not coded to use async routines (then comes the question, is there a support for it in an easy way as in other languages).
>>
>>Actually VFP can sometimes surprise you in displaying some multithreaded behavior - when you call a function which is a wrapper over API calls to the OS (handling files mostly, e.g. renaming, moving etc), it may report that it's done while it actually isn't. The task is just offloaded to OS's thread.
>
>I would be happy to be surprised, but unfortunate.
>Here is a real world scenario:
>For a slow network, I cache some slow moving data from remote SQL Server, locally to an SQLite database. Initial download of data might be slow. Say:
>Table1 is downloaded in 1 sec, written locally in 0.8 sec
>Table2 is downloaded in 60 sec, written locally in 40 sec
>Table3 is downloaded in 50 sec, written locally in 30 sec
>Table4 is downloaded in 1 sec, written locally in 0.7 sec
>
>Total time is 180+ seconds. I could save at least 60 seconds if I could do this on multiple threads.
>(well this is done once, but you know, still I would like it to be fast)

Hi Cetin, VFP has many options to do parallel processing .
Using one of them ( ParallelFox):
*  ( full listing at https://github.com/VFPX/ParallelFox/blob/master/examples/returncursor_after.prg )

Parallel = NewObject("Parallel", "ParallelFox.vcx")

	Parallel.StartWorkers(FullPath("ReturnCursor_After.prg"),,.t.)

	lnTimer = Seconds()
	
	Parallel.CallMethod("Query1",This.Class,This.ClassLibrary)
	Parallel.CallMethod("Query2",This.Class,This.ClassLibrary)
	Parallel.CallMethod("Query3",This.Class,This.ClassLibrary)
	Parallel.Wait()
	
	Select CustCsr.CustomerID, CustCsr.CompanyName, CustCsr.ContactName, ;
		OrderCsr.OrderID, OrderCsr.OrderDate, ;
		DetailCsr.ProductID, DetailCsr.Quantity, DetailCsr.UnitPrice ;
	from CustCsr ;
		join OrderCsr on OrderCsr.CustomerID = CustCsr.CustomerID ;
		join DetailCsr on DetailCsr.OrderID = OrderCsr.OrderID ;
	into cursor CustOrders
	
	? "Total Time", Seconds() - lnTimer
	
	Browse Last NoCaption NORMAL 		
Don't know much about Go but I don't think it can make it easier than this.
@nfoxdev
github.com/nfoxdev
Previous
Reply
Map
View

Click here to load this message in the networking platform