Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Asynchronous OLE
Message
From
23/06/1999 07:34:49
 
 
To
22/06/1999 23:33:59
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00232124
Message ID:
00232874
Views:
13
And thank you for telling, Erik. I appreciate it.

Cheers,

Jim N

>Jim-
>
>the new BUILD MTDLL and the corresponding functionality in the compile dialog are for building Multithreaded DLLs to be used as COM servers. These COM servers are multithreaded in that VFP6T.DLL (the new runtime library specifically for in-proc servers with SP3) can effectively start a new instance of the server when the one already instanciated is busy. This gets by the issue we had with earlier VFP in-proc servers that blocked an object's method call when another object had the server busy. This stuff is crucial in a web server environment, where IIS (by default) has 15 threads available for processing concurrent hits. If one person made a request on your site that required the VFP COM server to run a 15 second query, all other hits that required access that server had to wait until the first request was finished. An MTDLL, in conjunction with the new run-time fixes this by allowing a single server to start multiple threads.
>
>BUT- this "Apartment" multithreading is managed by the new runtime, and VFP processes still have no power to themselves spawn new threads.
>
>All this being said, Christof and Kenneth have shown that I was too quick to assert that multiple threads would be required for Kenneth's request. After looking at Christof's suggestion, I played around and successfully implemented a single-threaded server that starts a timer, returns control to the caller, and has the timer set an object property with the results of the query. This way the client can poll the server for results, and cancel if he chooses.
>
>This is pretty cool if the time-costly code is made up of a bunch of time-costly commands, or of a long loop. Because the client can set a cancel property on the server that the server can watch for at chosen intervals and stop processing if it has been set. But you'll have to be careful if your processor intensive work is a single command, like an SQL statement. We still don't have a mechanism to stop a command midway through. So while you can return control to the client, the server is still going to be cranking away, sucking up processor and memory resources.
>
>I learned a little bit today... thanks for asking.
>
>>i Erik,
>>
>>Your reply leads me to ask about the new BUILD MTDLL delivered in SP3. I do NOT have the software yet (awaiting arrival of CD), but it seems that it might make your statement obsolete. Do you have any information from the SP on how to use it, what it can do, etc?
>>
>>Jim N
>>
>>>>Is it possible to create an OLE server in Fox that will return control to the calling procedure immediately?
>>>>
>>>
>>>You have to fire off another thread to do this, and it's not really practical in VFP- what are you trying to do?
Previous
Reply
Map
View

Click here to load this message in the networking platform