Eu 3 multi processor?

new topic     » topic index » view thread      » older message » newer message

This is the first time I tried multi threading in Eu.

I made a program like this:

procedure task()
    for i = 1 to 100000000000 do
        task_yield()
        if remainder(i, 100000) = 0 then
            printf(1, "taskid %d is now %d\n", {task_self(), i})
        end if
    end for
end procedure

object t1, t2

t1 = task_create(routine_id("task"), {})
t2 = task_create(routine_id("task"), {})

task_schedule(t1, 1)
task_schedule(t2, 1)

while 1 do
    task_yield()
end while


The problem is I have dual core CPU but Eu only use one of them! So
CPU usage is only 50%.

Knowing the current CPU trend where the improvements are not in terms
of speed but having multiple cores, how can I have Eu utilize all the
CPU? Or did I made a wrong program above?

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu