On Fri, 15 Sep 2000 Tomasz Motylewski [mailto:[EMAIL PROTECTED]]
wrote:
> in response to:
> On Thu, 14 Sep 2000 [EMAIL PROTECTED] wrote:
>
> No, there exist also semephores in normal Linux kernel, and I
> also think that
> RTL distribution should contain RT semaphores.
RTL V3 contains semaphores.
> But to me using FIFOs and semaphores to communicate between two kernel
> modules is a bit strange. All address space is shared. Why
> don't you just
> save the data to a buffer and call the handler function from the
> other module directly? This is fastest. The only disadvantege
> I can see is
> that the handler will runn immediately and there is no way to
> lower the
> priority of processing task. To do task switch you will need
> semephore.
No, you don't really need a semaphore. If the handler task should
be running at lower priority, put it in a thread that runs at the lower
priority and blocks on a pthread_suspend_np just before using the data.
Then the (higher priority) process that writes the data simply calls
pthread_wakeup_np for the handler thread. Then when the CPU is available,
and the handler thread is the highest priority computable task, it will get
the CPU.
The key here is to understand that any module can use any global
data from any module and signal threads from other modules, etc. They are
all running in one big happy (most of the time) RTLinux playground.
Regards,
Steve
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/