forked from xuos/xiuos
test full 100 threads on XiZi, test is ok
This commit is contained in:
parent
3bec8f496a
commit
55c8de20d9
|
@ -25,11 +25,14 @@
|
|||
extern long ShowTask(void);
|
||||
extern unsigned int msleep(uint64_t msec);
|
||||
|
||||
#define BATCH_TEST_TASK_SIZE 100
|
||||
|
||||
static int32 tid1 = NONE;
|
||||
static int32 tid2 = NONE;
|
||||
static int32 tid3 = NONE;
|
||||
static int32 tid4 = NONE;
|
||||
static int32 tid5 = NONE;
|
||||
static int32 tids[BATCH_TEST_TASK_SIZE];
|
||||
|
||||
#define DYNAMIC_TASK_STACK_SIZE 3072
|
||||
#define PRIORITY 15
|
||||
|
@ -121,13 +124,6 @@ void DynamicTaskSchedTest(char* parm)
|
|||
strncpy(t_parm,"-b", 4);
|
||||
}
|
||||
#endif
|
||||
tid1 = KTaskCreate("d_tid1",
|
||||
Task1Entry,
|
||||
t_parm,
|
||||
DYNAMIC_TASK_STACK_SIZE,
|
||||
16);
|
||||
if (tid1 >= 0)
|
||||
StartupKTask(tid1);
|
||||
|
||||
tid2 = KTaskCreate("d_tid2",
|
||||
Task2Entry,
|
||||
|
@ -183,6 +179,22 @@ void DynamicTaskSchedTest(char* parm)
|
|||
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)
|
||||
{
|
||||
|
@ -192,8 +204,7 @@ static void UsageHelp(void)
|
|||
int TestTaskReadyAndSched(int argc, char * argv[])
|
||||
{
|
||||
DynamicTaskSchedTest(argv[0]);
|
||||
|
||||
BatchTaskSchedTest(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue