From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paleologos Spanos To: ecos-discuss@sources.redhat.com Subject: [ECOS] cyg_alarm Date: Mon, 22 Jan 2001 14:05:00 -0000 Message-id: X-SW-Source: 2001-01/msg00373.html 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.