Hi Salinda,
> I've been designing a product based on the ts7260 and one of
> my tasks is to implement control system using lot of sensors.
> I want to couple four sensors. So i used four UART serial
> ports by using Serial port extend card (TS-SER4 ).Those
> sensors running on different refresh rate.So for now
> I'm using threading for my program. One main thread for
> output for control system and another four threats for
> sensor system. Now my main threat running at 8Hz which
> is not enough for my application. This is mainly due to
> threading.
If you can *confirm* that it is due to threading, and not
associated with processor overloading. Then you can
eliminate the threads by using select() on each file
descriptor associated with each serial port. This is
called 'reactive' programming and is used in high
performance servers.
In the ACE C++ library, this is called the ACE_Reactor.
Look for the books called C++ Network Programming by
Steve Huston and Doug Schmidt. The TS boards could
probably use this C++ library, but I haven't tried.
> All the interrupt handle by the OS. We cant directly
> access to them.
Sure you can ... select the right OS. If your application
calls for an RTOS, or lighter-weight OS that Linux,
then use an RTOS.
> Because of that all for sensors threads running loop
> until UART buffer fill to some level....which mean
> wasting resource without doing nothing.....I think
> you guys got my point. I have good knowledge about
> micro controllers. In those micro controllers we can
> easily implement UART interrupt.But those micro
> controllers have only limited number of UART. If you
> have any suggestions for this problem please let me
> know. It will be very helpful to me.
Serial FIFOs are your 'friend', not your enemy. Every
time data is transferred between the kernel and user-space,
you have a context switch. The serial FIFOs reduce this
overhead.
Of course, there is always the chance that your application
overpowers this particular board. If you can, select something
more powerful, or interface the sensors differently.
For example, what do your serial port sensors do?
Cheers,
Dave
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|