From: "Robert McCullough" References: <000701c89a75$d349f630$9601a8c0@domain.hid> <18429.6412.785941.128928@domain.hid> Date: Wed, 9 Apr 2008 17:36:05 -0400 Message-ID: <000801c89a89$b7b09820$9601a8c0@domain.hid> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <18429.6412.785941.128928@domain.hid> Subject: Re: [Xenomai-help] mlockall questions Reply-To: rob@domain.hid List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Gilles Chanteperdrix' Cc: xenomai@xenomai.org Hi Gilles, --> -----Original Message----- --> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] --> Sent: Wednesday, April 09, 2008 3:29 PM --> To: rob@domain.hid --> Cc: xenomai@xenomai.org --> Subject: Re: [Xenomai-help] mlockall questions --> --> Robert McCullough wrote: --> > Hi, --> > --> > I am converting part of a C++ application to real-time. --> > --> > I noticed that all the Xenomai examples call --> > mlockall(MCL_CURRENT|MCL_FUTURE) at the beginning of main before --> creating --> > any real-time threads. --> > Is calling mlockall a requirement when using Xenomai? --> --> Yes it is. --> [Robert McCullough] OK. --> > --> > I have added a couple of Xenomai tasks to my C++ app. --> > A) Without calling mlockall my application seems to run fine but I --> noticed --> > in /proc/xenomai/stat that a few page faults occurred. --> --> Well normally your application should stop with a message telling you --> that you have not call mlockall. Do you happen to install a handler --> for --> SIGXCPU ? [Robert McCullough] Yes. --> --> > B) When calling mlockall at the beginning of my main() I do not see --> any page --> > faults but some of the C++ threads do not start. --> > --> > Why would mlockall cause some threads not to start? --> --> Well, you should check rt_task_create or pthread_create return --> value. The usual error is that you run out of memory because of the --> stack size problem explained in the TROUBLESHOOTING guide. --> --> -- --> --> --> Gilles. [Robert McCullough] Thanks. Calling "ulimit -s 2048" before my application in my startup script seems to work fine when I am running over nfs to the Denx ELDK with a bash shell. But my application needs to run from a CompactFlash card running BusyBox on a MPC5200 and BusyBox does not seem to support the "ulimit" command. Is there another way to set this stack limit size? Best regards, Robert McCullough