public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "A Shobhan" <shobana@in.ceeyes.com>
To: "Jonathan Larmour" <jlarmour@redhat.com>
Cc: <ecos-discuss@sourceware.cygnus.com>
Subject: Re: [ECOS] please help me
Date: Fri, 03 Aug 2001 12:27:00 -0000	[thread overview]
Message-ID: <000b01c11c53$952e0910$0f09010a@shobhan> (raw)
In-Reply-To: <3B6A9959.6F36B@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

hi
  iam here with attaching the file hello.c.  This code is working with
bitmap scheduler, but hanging if the eCos is build with multilevel
scheduler.

thanks


----- Original Message -----
From: "Jonathan Larmour" <jlarmour@redhat.com>
To: "A Shobhan" <shobana@in.ceeyes.com>
Cc: <ecos-discuss@sourceware.cygnus.com>
Sent: Friday, August 03, 2001 6:00 PM
Subject: Re: [ECOS] please help me


> A Shobhan wrote:
> >
> > Hi,
> >
> > I have a multi threaded program consists of just two threads on ARM =
> > 7TDMI SOC target. The program is running fine if the eCos is built with
=
> > "Bitmap Scheduler" option, I am able to create Mutex and =
> > cyg_thread_delay() is also working fine. If I use "Multi Level Scheduler
=
> > with Time Slicing Enabled" option the program is hanging at =
> > cyg_mutex_init() and no thread is working. The cyg_thread_delay() is =
> > also hanging.=20
> >
> > Why the cyg_mutex_init() is hanging in Multi level scheduler and not in
=
> > Bitmap scheduler?
> > Why cyg_thread_delay() is hanging in Multi level scheduler and not in =
> > Bitmap scheduler?
>
> You've probably made some assumption somewhere that you wouldn't get
> timesliced. But without seeing the program, we can't tell for sure!
>
> Jifl
> --
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
> Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
>

[-- Attachment #2: hello.c --]
[-- Type: text/x-c, Size: 1659 bytes --]

/* this is a simple hello world program */
#include <stdio.h>
#include <cyg/kernel/kapi.h>


/* now declare (and allocate space for) some kernel objects,
   like the two threads we will use */
cyg_thread thread_s[3];		/* space for two thread objects */

char stack[3][4096];		/* space for two 4K stacks */

/* now the handles for the threads */
cyg_handle_t simple_threadA, simple_threadB, simple_threadC;

/* and now variables for the procedure which is the thread */
cyg_thread_entry_t simple_program;

/* and now a mutex to protect calls to the C library */
cyg_mutex_t cliblock;


void cyg_user_start(void)
{


  cyg_mutex_init(&cliblock);

  cyg_thread_create(4, simple_program, (cyg_addrword_t) 0,
		    "Thread A", (void *) stack[0], 4096,
		    &simple_threadA, &thread_s[0]);
  cyg_thread_create(4, simple_program, (cyg_addrword_t) 1,
		    "Thread B", (void *) stack[1], 4096,
		    &simple_threadB, &thread_s[1]);

  cyg_thread_create(4, simple_program, (cyg_addrword_t) 2,
		    "Thread C", (void *) stack[2], 4096,
		    &simple_threadC, &thread_s[2]);

  cyg_thread_resume(simple_threadB);
  cyg_thread_resume(simple_threadC);
  cyg_thread_resume(simple_threadA);
	displayString("\r\nCalling Scheduler.... \r\n");

}

extern cyg_uint32 tick_count;
void simple_program(cyg_addrword_t data)
{
	int message = (int) data;
	int delay;
	
	//cyg_thread_delay(10);
	while(1)
	{
	
		cyg_mutex_lock(&cliblock);
		//cyg_scheduler_lock();
		diag_printf("Beginning execution; thread data is %d\r\n", data );
		cyg_mutex_unlock(&cliblock);
		//cyg_scheduler_unlock();
		//CYGACC_CALL_IF_DELAY_US(1000);
		cyg_thread_delay(100);
		//cyg_thread_yield();
	}
	
}

  reply	other threads:[~2001-08-03 12:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-02 22:09 A Shobhan
2001-08-03  5:31 ` Jonathan Larmour
2001-08-03 12:27   ` A Shobhan [this message]
2001-08-03 12:41     ` Jonathan Larmour
2001-08-03 13:36     ` [ECOS] mips_rm7000.ld and dwarf Chris Morrow
2001-08-03 13:45       ` Jonathan Larmour

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='000b01c11c53$952e0910$0f09010a@shobhan' \
    --to=shobana@in.ceeyes.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=jlarmour@redhat.com \
    /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 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).