Re: Semi-multithreaded application in VB6




"Matthias Julius" <jnews@xxxxxxxxxxxxxx> wrote in message
news:uzmmxqfpp.fsf@xxxxxxxxxxxxxxxxx
> "Steve Gerrard" <mynamehere@xxxxxxxxxxx> writes:
>
>
> Those libraries control a motion system and wait most of their time
> for that to finish its motion. I would hope they don't do busy
> waiting. But, I don't know.
>

IF they are doing I/O, they probably do yield to the OS and allowing messaging,
etc. so your events can probably get processed.

>
> The software is contolling a machine. The cycle takes about 30 s to
> complete. Most of this time are wait times, either waiting for
> external hardware or programmed delays. So, wasted CPU cycles for
> checking are probably not an issue.
>
> But, I need the operator to be able to abort the cycle at virtually
> any time. And there are also events from the hardware where the cycle
> needs to stop. Some conditions allow the cycle to be continued after
> they go away. So, I need to do the checking and handling for those
> events in each sub that might have break points in it to be able to
> coninue at the same spot.
>

The picture becomes clearer. I am reading between the lines here, but it sounds
like your code is generating a series of instructions to the external machine.

I am thinking that you could adopt a model where you first generated a sequence
of instructions and stored them in an array, then went to a loop that send each
instruction in turn, with checks for cancel, etc. in between.

If part of the code is responding to feedback from the machine to generate
further instructions, this may still be worth while. Just regenerate the rest of
the list of instructions, then go back to the send-each-instruction loop.

I would bet that generating the list of steps, without other interaction, would
be plenty fast enough.

Is something like this a possible approach?


.



Relevant Pages

  • Re: WaitForSingleObject() will not deadlock
    ... I'd like to see the EXACT SEQUENCE OF INSTRUCTIONS issued in the locking sequence, ... My issue about the 2 CPU clock cycles is that once the lock is set, ... cycle detection using non-recursive mutex: ...
    (microsoft.public.vc.mfc)
  • Re: AMD CodeAnalyst MASM only?
    ... that limited when instructions could dispatch together. ... can execute instructions out of order, so it is a little more difficult to ... unitused, decode cycle, execute cycle, and retire/writeback cycle. ... Next I have the decode field. ...
    (comp.lang.asm.x86)
  • Re: PIC + DDS = Frequency Synthesizer?
    ... thus the software calculation loop cycle time ... are 20 instructions available to update the phase accumulator, ... lookup and control the DAC. ... software loop cycle. ...
    (comp.arch.embedded)
  • Prescott Disappoints
    ... you might as well emulate most constant multiplies. ... Increased latencies of floating-point instructions. ... are now 1 cycle slower. ... What advantages does Prescott have? ...
    (comp.lang.asm.x86)