All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Daniel Schnell <daniel.schnell@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] MPC5200 OOPS time
Date: Mon, 20 Nov 2006 10:29:26 +0100	[thread overview]
Message-ID: <45617576.8040509@domain.hid> (raw)
In-Reply-To: <DD39B5C3F4963040ADC9768BE7E430CB015D4834@domain.hid>

Daniel Schnell wrote:
> Hi,
> 
> 
> Gilles Chanteperdrix wrote:
> 
>>You should set the threads stack size with pthread_attr_setstacksize
>>(as other pthread_attr_set* functions, it should be used on a
>>previously initialized pthread_attr_t structure), ulimit -s only set
>>the stack size of the main thread, at least on some architectures.   
> 
> 
> pthread_attr_setstacksize() doesn't work for us. The system still does
> allocate the default linux stack size. Whereas ulimit -s sets the stack
> size for all created threads correctly.

pthread_attr_setstacksize does not work for the main thread, but works
for other threads on all architectures where I tested it, could you
check the return value ?

> 
> Can this confirm somebody with an mpc5200B based board (e.g. icecube,
> lite5200) ?
> 
> 
>>This is probably unrelated to the errors you see, but:
>>- passing the pthread_mutex_t by value is not supposed to work; once
>>a pthread_mutex_t is initialized with pthread_mutex_init, you should
>>pass the address of the very same pthread_mutex_t to other functions
>>of the API.  
> 
> 
> Hmm, this is mystique to me. pthread_mutex_t is a structure returned by
> value from within MutexCreate(). Passing structures back by value
> doesn't do harm to them. Also the pthread_mutex function seem to operate
> normally.

It works with Xenomai posix skin, because the structure simply holds a
pointer to the real structure used by the kernel, but this is so for
quite unobvious reasons (namely because sizeof(pthread_mutex_t) is to
small, and because it allows pthread_mutex_t to be shared between kernel
and user-space). But an implementation of the POSIX API could decide to
put the mutex lock count in the pthread_mutex_t structure, or to put the
pthread_mutex_t in a linked list, in these two cases, copying the
pthread_mutex_t would be wrong.


-- 
                                                 Gilles Chanteperdrix


      reply	other threads:[~2006-11-20  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 16:20 [Xenomai-help] MPC5200 OOPS time Daniel Schnell
2006-11-17 16:55 ` Gilles Chanteperdrix
2006-11-17 19:42   ` Daniel Schnell
2006-11-20  9:29     ` Gilles Chanteperdrix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45617576.8040509@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=daniel.schnell@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.