All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice Congo <congo_p@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] rt_task_spawn how to
Date: Wed, 28 Dec 2005 01:41:08 +0100 (CET)	[thread overview]
Message-ID: <20051228004108.2353.qmail@domain.hid> (raw)

Hi all,

is it posible to spawn a  task from another rt task?
The following code tries to, but does not succeed:
<code>
#include <string.h>
#include <stdio.h>

#include <native/task.h>
//#include <general_macros.h>

#define STACK_SIZE 8192

RT_TASK spawner;
RT_TASK spawnee;
void spawner_work(void* c);
void spawnee_work(void* c);

void spawner_work(void* c)
{
	printf("\nspawner\n");
	//SWITCH_TASK_TO_SECONDARY_MODE();
	int
ret=rt_task_spawn(&spawnee,"spawnee",STACK_SIZE,50,0,spawnee_work,NULL);
	printf("IN SPAWNER WORK: ret=%d
%s\n",ret,strerror(ret));
}

void spawnee_work(void* c)
{
	printf("I am spawnee");	
}

int main(int argc, char *argv[])
{
	int ret=
	
rt_task_spawn(&spawner,"spawner",STACK_SIZE,50,0,spawner_work,NULL);
	printf("\nIN MAIN:ret=%d %s\n",ret,strerror(-ret));
	getchar();
	return 0;
}


</code>

the resulting output is:
<output>
spawner

IN MAIN:ret=0 Success

</output>
This means that the task "spawner" starts but get
blocked at rt_task_spwan call.

Switching context explicitely to secondary or to
primary does not help too.

can you help?

best, patrice


	

	
		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


             reply	other threads:[~2005-12-28  0:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-28  0:41 Patrice Congo [this message]
2005-12-28 11:36 ` [Xenomai-help] rt_task_spawn how to Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2005-12-28  0:22 Patrice Congo

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=20051228004108.2353.qmail@domain.hid \
    --to=congo_p@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.