From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4CD5B112.8040904@domain.hid> Date: Sat, 06 Nov 2010 20:48:34 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4CD55D61.7050208@domain.hid> <4CD59C5F.6030808@domain.hid> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] detect mode switches to primary mode List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Pastor Cc: xenomai@xenomai.org Peter Pastor wrote: > Hey Gilles, > >>> There is no such thing as unwanted mode switches from secondary mode > to primary mode. > Really ?? I want to ensure that my boarder line thread runs in SECONDARY > mode except when it is accessing the shared memory. The reason for that > is that I want linux to be able to preempt that thread if necessary. I > have enabled the Xenomai watchdog to kill real-time threads when they > starve the linux kernel. Thus, the result is that this watchdog kills > (or sometimes only preempts?) my boarder line thread (preempting is OK, > but killing is NOT). I see that the watchdog kicked in in the logs > (dmesg). This happens roughly every 5-10min or so... My idea is, that if > I force the thread to run in secondary mode (after accessing the shared > memory), it will be a regular linux thread (and can be preempted). Thus, > having it switch to primary mode is unwanted, is it ? > > What am I missing here ? If the watchdog kills a thread, it means that the thread has an infinite loop. The bug is this infinite loop, not the fact that the thread is running in primary mode. You can install a handler for the watchdog signal to see where the infinite loop is. -- Gilles.