Verified roundrobin test

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@87 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2007-03-17 23:22:05 +00:00
parent e38d16d17a
commit ae95280dab
3 changed files with 25 additions and 6 deletions
+3 -2
View File
@@ -39,12 +39,13 @@
* Added 'ls' command to nsh * Added 'ls' command to nsh
* Added C5471 watchdog driver * Added C5471 watchdog driver
* Added support for the Neuros OSD / DM320 * Added support for the Neuros OSD / DM320
* Fixed another bug where free() is called from IDEL task. * Fixed another bug where free() is called from IDLE task.
Can't do this; the caller must be able to wait for access Can't do this; the caller must be able to wait for access
to memory. to memory.
* Separated C5471 serial driver; a shareable part is * Separated C5471 serial driver; a shareable part is
in drivers/. ; the C5471 specific part is in arch/C5471. in drivers/. ; the C5471 specific part is in arch/C5471.
serial.h defines the interface. serial.h defines the interface.
* Fixed mq_receive() -- bad memcpy() * Fixed mq_receive() and mq_send() -- bad memcpy()
* Added a test for roundrobin scheduler.
-2
View File
@@ -164,12 +164,10 @@ static int user_main(int argc, char *argv[])
sighand_test(); sighand_test();
#endif #endif
#if 0 /* Does not work yet */
#if !defined(CONFIG_DISABLE_PTHREAD) && CONFIG_RR_INTERVAL > 0 #if !defined(CONFIG_DISABLE_PTHREAD) && CONFIG_RR_INTERVAL > 0
/* Verify round robin scheduling */ /* Verify round robin scheduling */
rr_test(); rr_test();
#endif
#endif #endif
printf("user_main: Exitting\n"); printf("user_main: Exitting\n");
+22 -2
View File
@@ -47,7 +47,11 @@
* Definitions * Definitions
********************************************************************************/ ********************************************************************************/
#define CONFIG_NINTEGERS 32768 /* This number may need to be tuned for different processor speeds */
/* #define CONFIG_NINTEGERS 32768 Takes forever on 60Mhz ARM7 */
#define CONFIG_NINTEGERS 2048
/******************************************************************************** /********************************************************************************
* Private Data * Private Data
@@ -121,10 +125,16 @@ static void *sieve1(void *parameter)
int i; int i;
printf("sieve1 started\n"); printf("sieve1 started\n");
fflush(stdout);
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
{ {
dosieve(prime1); dosieve(prime1);
} }
printf("sieve1 finished\n");
fflush(stdout);
pthread_exit(NULL); pthread_exit(NULL);
} }
@@ -137,10 +147,16 @@ static void *sieve2(void *parameter)
int i; int i;
printf("sieve2 started\n"); printf("sieve2 started\n");
fflush(stdout);
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
{ {
dosieve(prime2); dosieve(prime2);
} }
printf("sieve2 finished\n");
fflush(stdout);
pthread_exit(NULL); pthread_exit(NULL);
} }
@@ -203,7 +219,11 @@ void rr_test(void)
printf("rr_test: Error in thread 2 creation, status=%d\n", status); printf("rr_test: Error in thread 2 creation, status=%d\n", status);
} }
printf("rr_test: Waiting for sieves to complete\n"); printf("rr_test: Waiting for sieves to complete -- this should take awhile\n");
printf("rr_test: If RR scheduling is working, they should complete at\n");
printf("rr_test: then same time\n");
fflush(stdout);
pthread_join(sieve2_thread, &result); pthread_join(sieve2_thread, &result);
pthread_join(sieve1_thread, &result); pthread_join(sieve1_thread, &result);
printf("rr_test: Done\n"); printf("rr_test: Done\n");