AX Sandwich Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AX Sandwich Problem

Umur
I've written an AX component using Dolphin. It calls other AX components.
However, I have implemented a call which returns in a very long time.

It used to block the user interface. Then I started pass the ax call
through "defendProcess:" below. It solved that problem. The ax client gets
its answer (after waiting for a very long calculation) and dolphin ui does
not block.

So what? Since I have "defendProcess", I am NO MORE GETTING EVENTS from
other 3rd party ax components.

ANY IDEAS?

-------------------------
defendProcess: call
        | sem p returnedException |
        returnedException := DeafObject current.
        sem := Semaphore new.
        p := Processor activeProcess.
       
        [
        [p suspend.
        [call value] on: Error do: [:ex | returnedException := ex]] ensure:
                                [p resume.
                                sem signal]]
                        fork.
        sem wait.
        returnedException pass


Reply | Threaded
Open this post in threaded view
|

Re: AX Sandwich Problem

Schwab,Wilhelm K
> I've written an AX component using Dolphin. It calls other AX components.
> However, I have implemented a call which returns in a very long time.
>
> It used to block the user interface. Then I started pass the ax call
> through "defendProcess:" below. It solved that problem. The ax client gets
> its answer (after waiting for a very long calculation) and dolphin ui does
> not block.
>
> So what? Since I have "defendProcess", I am NO MORE GETTING EVENTS from
> other 3rd party ax components.

I will defer to Blair on this, but I would be very suprised if what you
have in mind can work.  Dolphin is largely a single threaded system,
with some ability to call functions on other OS threads, and IIRC the
garbage collector uses an OS thread.  However, it is not free threaded
for COM purposes, so it needs the message queue to synchronize calls.

Blair has at times talked about marshaling interface pointers to threads
to allow overlapped COM calls, but I have no idea whether he has made
any progress on it.  Further, I would doubt that most ActiveX controls
in the world would be safe to call on arbitrary threads, especially any
graphical stuff.

You might find that you can use either an OS event/semaphore or design
with connectable objects to set up a situation in which you make a call
to start something happening, and have the component signal you when it
is complete.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: AX Sandwich Problem

Umur
Thanks. I already found an answer. Call "forkMainIfMain" while getting ax
client calls. And everything works nicely.