Hi guys,
I'm trying to do dynamic multiple loading data,
because the data size is difference, if the data is big the loading process takes a while and taking much cpu,
so I want to load data pararelly as many as I can before reach 350% cpu because we have 4 cpus (400%).
just wondering whether there is a way of doing this in pseudo code :
say I have 20 data
I'm stuck in checking cpu process, please show some ideas...
Thanks guys.
I'm trying to do dynamic multiple loading data,
because the data size is difference, if the data is big the loading process takes a while and taking much cpu,
so I want to load data pararelly as many as I can before reach 350% cpu because we have 4 cpus (400%).
just wondering whether there is a way of doing this in pseudo code :
say I have 20 data
Code:
for (i=1;i<=20;i++)
do
while [cpu process -lt 90%]
do
loading data[i] &
done
done
wait
I'm stuck in checking cpu process, please show some ideas...
Thanks guys.