It's cleaner to use channels with separate io and timer threads that
do their syscalls via ioproc; this one doesn't require any changes to libthread:
https://gist.github.com/9nut/aaa9b9b6a22d69996b75ccdc6e615c61
On Mon, Jun 20, 2022 at 8:57 AM wrote:
>
> В Пн, 20/06/2022 в 05:59 +, adr
В Пн, 20/06/2022 в 05:59 +, adr пишет:
> On Mon, 20 Jun 2022, adr wrote:
> > But I have something in mind for a case like
> > this, when all the processes are going to use the same handler
> > (that's why I was asking). Let me play with it a litle before I
> > share it.
>
> Ok, the idea is
The last mail got screwed, I'm resending this for clarity.
/sys/src/libthread/sched.c:
[...]
if(t == nil){
_threaddebug(DBGSCHED, "all threads gone; exiting");
cancelnotes(p->pid);
_schedexit(p);
}
On Mon, 20 Jun 2022, adr wrote:
But I have something in mind for a case like
this, when all the processes are going to use the same handler
(that's why I was asking). Let me play with it a litle before I
share it.
Ok, the idea is this: If in is bigger than zero in
threadnotify(int (*f)(void*,