Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Existing application to Multi Threaded App
Message
From
24/12/2013 03:06:39
 
 
To
23/12/2013 13:18:34
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01590785
Message ID:
01590935
Views:
54
Update,
Yes sir, This PRG is the slowest Part of my Entire Process. Here it is.
DECLARE INTEGER _apCreate@0   IN ps2pdf.dll AS apCreate
DECLARE         _apClose@4    IN ps2pdf.dll AS apClose   INTEGER id
DECLARE INTEGER _apConvert@4  IN ps2pdf.dll AS apConvert INTEGER id
DECLARE INTEGER _apSetFunc@24 IN ps2pdf.dll AS apSetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
DECLARE INTEGER _apGetFunc@24 IN ps2pdf.dll AS apGetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
#define AP_Set_Output     3000
#define AP_Set_Input      3001
SELECT Convert
GO top
SCAN
** Convert ps files to a general pdf file.
iFilename=ALLTRIM(oldpath) && The Path of File that is to be converted i.e Input file
oFilename=ALLTRIM(Newpath) && The Path of File that is to be converted into new PDF format i.e output file
id = apCreate()
IF (id # 0)
   apSetFunc(id, AP_Set_Input , 0, 0, '&iFilename' , 0)  &&input file.
   apSetFunc(id, AP_Set_Output, 0, 0, '&oFilename', 0) &&output format and file.
    iRet = apConvert(id)
    apClose(id)
ENDIF
ENDSCAN
The process is taking ample time and my objective is to reduce it to minimum (by multi threading or otherwise)

Regards


>>I have an application written in VFP-9. The said applications has MENU, Forms, PRG etc.
>>Oneof the PRG requires Scan-Endscan loop and in between that conversion of Data.
>>
>>It takes a lot time even on fully loaded I-7 PC. Some expert suggested me to use Multi thread.
>>
>>Is is possible to convert my application existing application to MT application so that the performance could enhance.
>>
>>Anybody having Idea , kindly guide.
>>
>>Regards
>
>I have seen many examples of programmers wasting CPU cycles. For example
>
>SCAN ALL
> IF this and that
> replace field with something
> endif
>
> if not this and not that
> replace field with somethingelse
> endif
>ENDSCAN
>
>It is much faster to optimize that
>
>REPLACE field with something for this and that
>REPLACE field with somethingelse for not this and not that.
>
>In other words, are you scanning all records and calling the conversion of data or are you targeting the conversion? If I remember correctly, you are trying to convert PDF files? You can improve things by declaring the dlls at the start of the entire process rather than at each file....
>
>Is the one PRG the slowest part of your system? If so, post that prg and let's see what can be done.
Harsh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform