public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] thread creation
@ 2004-09-14 12:17 Aravind B
  2004-09-14 12:27 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: Aravind B @ 2004-09-14 12:17 UTC (permalink / raw)
  To: ecos

hi all,
i have written small application which has  2 threads.
small part of it is as follows:
void cyg_user_start(void)
{
	printf("entering two threads cyg_user_start() function\n");
	cyg_thread_create(4,simple_program,(cyg_addrword_t)0,
			  "Thread A",(void*) stack[0],4096,
			  &simple_threadA,&thread_s[0]);
	cyg_thread_create(5,simple_program1,(cyg_addrword_t)1,
			 "Thread B",(void*) stack[1],4096,
			 &simple_threadB,&thread_s[1]);
cyg_thread_resume(simple_threadA);
cyg_thread_resume(simple_threadB);
}
when the control comes for execution of second thread the system hangs.
on debug i found that the control is in thread.cxx.
why is this happening and how to overcome this.

thanking advance.

Aravind B 



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [ECOS] Thread creation
@ 2001-04-10 15:42 Paleologos Spanos
  2001-04-10 18:11 ` Jonathan Larmour
  0 siblings, 1 reply; 8+ messages in thread
From: Paleologos Spanos @ 2001-04-10 15:42 UTC (permalink / raw)
  To: ecos-discuss

 HI,I have a question concerning the creation of threads in eCos.THe
reference manual says that first I have to create the threads and then
starts the scheduler which never returns.Does it mean that I can not
create new threads after the scheduler starts ?
 How can I create dynamically new threads after the scheduler starts?

                                   Thank you.


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [ECOS] THread creation
@ 2001-04-10 14:45 Paleologos Spanos
  2001-04-10 23:36 ` Jesper Skov
  0 siblings, 1 reply; 8+ messages in thread
From: Paleologos Spanos @ 2001-04-10 14:45 UTC (permalink / raw)
  To: ecos-discuss

 HI,I have a question concerning the creation of threads in eCos.THe
reference manual says that first I have to create the threads and then
starts the scheduler and never returns.Does it mean that I can not create
new threads after the scheduler starts ?
 How can I create dynamically new threads after the scheduler starts?

                                   Thank you.

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [ECOS] Thread Creation
@ 2000-09-22  4:28 Sandeep Rikhi
  2000-11-06 21:00 ` Jonathan Larmour
  0 siblings, 1 reply; 8+ messages in thread
From: Sandeep Rikhi @ 2000-09-22  4:28 UTC (permalink / raw)
  To: eCos Discussion Gp.

Respected Sir

I'm not able to understand
a few points in eCos 1.2.1 source code.
May I request you to put some light on the the 
following :-

 Supposedly I create a thread through API call

cyg_thread_create(. . . )

which requires address of an object of cyg_thread 
structure ( i.e. cyg_thread * thread) , along with 
other parameters. The data members of the class 
Cyg_Thread contain the data memebers of the 
structure cyg_thread. I don't understand, how 
exactly are they related.

Now the code inside cyg_thread_create (file name kapi.cxx)
is having the following statements :-

 Cyg_Thread * t = new ((void *) thread ) Cyg_Thread(
			(CYG_ADDRWORD) sched_info,
			(cyg_thread_entry *) entry,
			(CYG_ADDRWORD) entry_data,
			name,
			(CYG_ADDRWORD) stack_base,
			stack_size);
t=t;


Now, I have three doubts
 1. Which of the various overloaded new operators is 
	being used and what exactly does it do ?
 2. In new operator we are making a call to a constructor.
    How can we make a call to the constructor of a 
    class i.e. Cyg_Thread class. Traditionally, we
    can not make explicit call to a constructor.
 3. Also, what is the significance of the statement
    t=t; Isn't redundant ?
Sir, The above three doubts are very much generic, I would
   say. e.g. Similar is the case when a messagebox is created
   through the cyg_mbox_create API call.

Kindly Help !

********Sandeep Rikhi *******************


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-09-14 12:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-14 12:17 [ECOS] thread creation Aravind B
2004-09-14 12:27 ` Gary Thomas
  -- strict thread matches above, loose matches on Subject: below --
2001-04-10 15:42 [ECOS] Thread creation Paleologos Spanos
2001-04-10 18:11 ` Jonathan Larmour
2001-04-10 14:45 [ECOS] THread creation Paleologos Spanos
2001-04-10 23:36 ` Jesper Skov
2000-09-22  4:28 [ECOS] Thread Creation Sandeep Rikhi
2000-11-06 21:00 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).