test full 100 threads on XiZi, test is ok

This commit is contained in:
wlyu 2022-09-21 19:32:18 +08:00
parent 3bec8f496a
commit 55c8de20d9
1 changed files with 30 additions and 19 deletions

View File

@ -25,11 +25,14 @@
extern long ShowTask(void); extern long ShowTask(void);
extern unsigned int msleep(uint64_t msec); extern unsigned int msleep(uint64_t msec);
#define BATCH_TEST_TASK_SIZE 100
static int32 tid1 = NONE; static int32 tid1 = NONE;
static int32 tid2 = NONE; static int32 tid2 = NONE;
static int32 tid3 = NONE; static int32 tid3 = NONE;
static int32 tid4 = NONE; static int32 tid4 = NONE;
static int32 tid5 = NONE; static int32 tid5 = NONE;
static int32 tids[BATCH_TEST_TASK_SIZE];
#define DYNAMIC_TASK_STACK_SIZE 3072 #define DYNAMIC_TASK_STACK_SIZE 3072
#define PRIORITY 15 #define PRIORITY 15
@ -121,13 +124,6 @@ void DynamicTaskSchedTest(char* parm)
strncpy(t_parm,"-b", 4); strncpy(t_parm,"-b", 4);
} }
#endif #endif
tid1 = KTaskCreate("d_tid1",
Task1Entry,
t_parm,
DYNAMIC_TASK_STACK_SIZE,
16);
if (tid1 >= 0)
StartupKTask(tid1);
tid2 = KTaskCreate("d_tid2", tid2 = KTaskCreate("d_tid2",
Task2Entry, Task2Entry,
@ -183,6 +179,22 @@ void DynamicTaskSchedTest(char* parm)
StartupKTask(tid5); StartupKTask(tid5);
} }
static void BatchTaskSchedTest(char* parm)
{
memset(tids, 0, sizeof(int32) * BATCH_TEST_TASK_SIZE);
char task_name[20] = "batch_tid_";
for(int i = 0; i < BATCH_TEST_TASK_SIZE;i++){
task_name[9] = (char)(i / 100 + '0');
task_name[10] = (char)((i / 10) % 10 + '0');
task_name[11] = (char)(i % 10 + '0');
task_name[12] = 0;
tids[i] = KTaskCreate(task_name, Task2Entry, task_name, 128, 15);
if(tids[i] >= 0){
StartupKTask(tids[i]);
}
}
}
/********************************************************************/ /********************************************************************/
static void UsageHelp(void) static void UsageHelp(void)
{ {
@ -192,8 +204,7 @@ static void UsageHelp(void)
int TestTaskReadyAndSched(int argc, char * argv[]) int TestTaskReadyAndSched(int argc, char * argv[])
{ {
DynamicTaskSchedTest(argv[0]); DynamicTaskSchedTest(argv[0]);
BatchTaskSchedTest(argv[0]);
return 0; return 0;
} }