Req for task.e

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


Can we get a task_start()?

This would be like a task_schedule(), but not ever called again. With task_start(), the task begins, and runs until it yields or delays for a moment(s), and then resumes. This might save overhead?

procedure OnceEveryOtherSec() 
  while 1 do 
    task_delay(2) 
    if equal(get_key(),'q') then 
      abort(0) 
    end if 
    -- do this thing once every 2 seconds forever 
    -- do this other thing once every 2 seconds forever too 
  end while 
end procedure 
 
junk = task_create(routine_id("OnceEveryOtherSec"), {})  
task_start(junk) 
 

It's still a task, it's just not called again by the task scheduler. I am using task_schedule(junk,1) now, but it seems inappropriate, and wastefull.

useless

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

Search



Quick Links

User menu

Not signed in.

Misc Menu