Re: How to Convert 8bit into 6bit AIS encapsulation?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Jacquelin Hardy" <jachardy@xxxxxxxxxxxx> wrote

Do you think it is more effective to use a table or to go the other way?

I would suggest the more optimal method would use a look-up table opposed
to calculations. But, to be sure, timed trials would be advisable.


Can my decoding routine be the reason for the slow down ?

I can't be sure without further knowlege of your system.


One last question, when a timer fires an event at a choosen interval of
1 second, is it possible that the event is not fired if the processor is
too busy ? If this is the case, is there a way around this ?

The timer event is queued such that it can be delayed for a number
of reasons. A busy processor could cause a delay. Also, if code in
your timer event is still running when another event is due, that second
event would be missed entirely (never enter the queue).

There is no way to do more work in less time than it takes to do the
work. A slower machine is going process data slower. What you
can do, depending on your circumstances, is acknowlege that the
real world may get pretty hectic and encorporate a means to cope
with the onslaught.

One such method is to use queues to 'decouple' your input gathering
code from the code that processes the data. While you might be
able to gather input more quickly, with less missed input, it could
also mean that during periods of heavy use, you would see increased
lag between what has come in, and what has been processed.

What that might entail is that your timer event poll for input and
extract the message and put it in a queue. Code running elsewhere
(in another process even) could check to see if the queue has
data and pull the data off for processing, looping the process
until the queue is empty.

While this article is old and the code a little bloated for what you
want to do, it may give you some ideas, and a few snippettes of
code you can reuse:

http://www.devx.com/vb2themax/Article/19890

HTH
LFS











.



Relevant Pages

  • Re: Timer not being time-true
    ... Windows works by sending message on a queue. ... pumps a message and executes it... ... >I have a form that requeries data every 20 seconds based on a timer event. ... > sometimes the requery intervals are longer than 20 secons - sometimes as ...
    (microsoft.public.access.formscoding)
  • Question about DoEvents
    ... it also has a method that adds an item to the queue ... sub additem ... and control is going to the timer event (If the timer event fires at ...
    (microsoft.public.vb.general.discussion)
  • Re: Time outs and state machines
    ... The ACK message gets put on the queue and immediately after the ... I was thinking about giving each timer event a unique ID as ... connection to is reset to bring all parties into a definite state. ...
    (comp.object)
  • Re: Question about DoEvents
    ... If the queue is processing, it will accept additional queue items, and will ... doevents in the addItem method, it made me think that the doevents fired ... just as the timer event was firing to check for additional items (which it ... I wonder if perhaps the doevents in the addToQueue sub in the server is ...
    (microsoft.public.vb.general.discussion)