public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Paleologos Spanos <paleolog@ee.ucla.edu>
To: ecos-discuss@sources.redhat.com
Subject: [ECOS] cyg_alarm
Date: Mon, 22 Jan 2001 14:05:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.10.10101221337260.2093-100000@sierra.ee.ucla.edu> (raw)

 Hi,I have a problem concerning the alarm's function.
 I have 2 threads which are containing an alarm each.I have set these 2
alarms so as every 5000 ticks  the alarm in thread 1 to trigger a
function
which will kill and resume thread 2.With the same way the alarm in thread
2 is set so as to trigger a function which kills and resumes thread1 every
3500 ticks.I have noticed haowever a strange behaviour of the threads.

 1)The threads are not killed at the desired time points.I would expect to
see the thread1(highest priority) to start every 3500 ticks(at
3500,7000,10500 ,etc..)



 2)the threads do not stop their execution at these points.I mean that if
the thread 1 is a counter from 1-100 ,The output still be a counter from
1-100 .I would expect that sometimes it would be stopped at 80 or 47 or
any number it had counted until the point of killing.That means that the
thread is not killed, right? 

 I am using the below code inside the thread:
    THREAD 
{
   ...
   ... 
  cyg_clock_to_counter(cyg_real_time_clock(),..);
  cyg_alarm_create(..,         );
  cyg_alarm_initialize(..  ,cyg_current_time()+3500,3500);

void test_alarm_func2(cyg_handle_t alarmH2,cyg_addrword_t data2)
{
        cyg_thread_kill(simple_threadA);
        cyg_thread_resume(simple_threadA);
}

 After this I would expect  that the other thread should restart every
3500 ticks.

  What am I doing wrong.Do I have misunderstood something?


  Thank you for your interest in advance. 

             reply	other threads:[~2001-01-22 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-22 14:05 Paleologos Spanos [this message]
2003-07-02 10:52 [ECOS] Cyg_Alarm Matthieu.GIRARDIN
2003-07-03 14:32 ` Nick Garnett

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=Pine.GSO.4.10.10101221337260.2093-100000@sierra.ee.ucla.edu \
    --to=paleolog@ee.ucla.edu \
    --cc=ecos-discuss@sources.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).