Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HowTo: Multithreading/Multitasking
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
HowTo: Multithreading/Multitasking
Miscellaneous
Thread ID:
00329228
Message ID:
00329228
Views:
55
Does anyone know why the following code does not run multithreading? I have compiled the class below with MultiEXE and MultiUSE. I call it with the following commands, BUT it waits until the first ServerExec completes. I would like it to return and be able to start the second one.

Any ideas

Thanks, -Costas

* Called as follows
obj=createobject('foxqlsvr.serverclass')
obj.serverexec('1') && Waits here for completion
obj.serverexec('2')

*** EXE Multithreading Class compiled seperately ****
Define class ServerClass as custom OLEPublic

Procedure ServerExec(parm)

Do case
Case parm='1'
* Take a long time
f1=fcreate('case1.txt')
fput(f1,time())
for i=1 to 5000
use test alias test
select * from test into temp
use
use in test
endfor
fput(f1,time())
fclose(f1)

Case parm='2'
* Take a short time
f2=fcreate('case2.txt')
fput(f2,time())
fput(f2,time())
fclose(f2)
endproc

Enddefine
Next
Reply
Map
View

Click here to load this message in the networking platform