From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [bug?] set pthread stack size broken
Date: Thu, 08 Dec 2005 23:53:12 +0100 [thread overview]
Message-ID: <4398B958.8040705@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 846 bytes --]
Hi,
something for the night: Can someone explain why normal pthreads can be
restricted to initially use only the stack size provided via
pthread_attr_setstacksize() while any rt-mapped thread (posix and
native) refuse to accept this? For a simple test, compile the attached
program one time as normal
gcc -lpthread -o stacksize stacksize.c
and the other time against xeno's posix skin
gcc `xeno-config --posix-cflags` `xeno-config --posix-ldflags` \
-o stacksize.o stacksize.c
Then compare the memory requirements of both processes - they should
differ by 2M, the stack size when pthread_attr_setstacksize is not used.
Strange - and also critical when considering larger applications...
So far I only tested against 2.1, but I don't see a reason why 2.0.x
should behave different. Will get checked, though.
Any ideas?
Jan
[-- Attachment #1.2: stacksize.c --]
[-- Type: text/plain, Size: 450 bytes --]
#include <sys/mman.h>
#include <unistd.h>
#include <limits.h>
#include <pthread.h>
static void *simple_thread(void *arg)
{
sleep(30);
return 0;
}
int main (int ac, char **av)
{
pthread_t pth;
pthread_attr_t attr;
mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
pthread_create(&pth, &attr, simple_thread, NULL);
sleep(30);
return 0;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
next reply other threads:[~2005-12-08 22:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-08 22:53 Jan Kiszka [this message]
2005-12-09 7:24 ` [Xenomai-core] [bug?] set pthread stack size broken Jan Kiszka
2005-12-09 16:19 ` Jan Kiszka
2005-12-09 16:44 ` Philippe Gerum
2005-12-09 19:58 ` Jan Kiszka
2005-12-10 10:45 ` Philippe Gerum
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=4398B958.8040705@domain.hid \
--to=jan.kiszka@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.