const Vector v = EV_SHREDS(o);
const VM_Shred sh = (VM_Shred)vector_front(v);
if(sh) {
- shredule(sh->tick->shreduler, sh, .5);
+ shredule(sh->tick->shreduler, sh, GWION_EPSILON);
vector_rem(v, 0);
}
}
ANN void broadcast(const M_Object o) {
for(m_uint i = 0; i < vector_size(EV_SHREDS(o)); i++) {
const VM_Shred sh = (VM_Shred)vector_at(EV_SHREDS(o), i);
- shredule(sh->tick->shreduler, sh, .5);
+ shredule(sh->tick->shreduler, sh, GWION_EPSILON);
}
vector_clear(EV_SHREDS(o));
}
static MFUN(shred_yield) {
const VM_Shred s = ME(o);
const Shreduler sh = shred->tick->shreduler;
- shredule(sh, s, .5);
+ shredule(sh, s, GWION_EPSILON);
}
static SFUN(vm_shred_from_id) {
shred->info->vm = (VM*)vm;
shred->info->me = new_shred(shred, 1);
shreduler_add(vm->shreduler, shred);
- shredule(vm->shreduler, shred, .5);
+ shredule(vm->shreduler, shred, GWION_EPSILON);
return shred->tick->xid;
}
ANN m_uint vm_fork(const VM* src, const VM_Shred shred) {
VM* vm = shred->info->vm = gwion_cpy(src);
shred->info->me = new_shred(shred, 0);
-// shreduler_add(vm->shreduler, shred);
-// shredule(vm->shreduler, shred, .5);
shreduler_add(vm->shreduler, shred);
- shredule(vm->shreduler, shred, .5);
+ shredule(vm->shreduler, shred, GWION_EPSILON);
return shred->tick->xid;
}
timeadv:
reg -= SZ_FLOAT;
-{
- register const m_float f = *(m_float*)(reg-SZ_FLOAT);
- *(m_float*)(reg-SZ_FLOAT) = (shred->tick->wake_time += f);
-//printf("here adv %p %lu\n", s, s->bbq->is_running);
- shredule(s, shred, f);
-//printf("here adv %p %p %lu\n", shred->tick->shreduler, s, s->bbq->is_running);
-}
-shred->code = code;
-shred->reg = reg;
-shred->mem = mem;
-shred->pc = pc;
+ shredule(s, shred, *(m_float*)(reg-SZ_FLOAT));
+ *(m_float*)(reg-SZ_FLOAT) += vm->bbq->pos;
+ shred->code = code;
+ shred->reg = reg;
+ shred->mem = mem;
+ shred->pc = pc;
break;
setcode:
a.code = *(VM_Code*)(reg-SZ_INT);