Re: [9fans] syscall silently kill processes

2022-06-28 Thread adr
On Tue, 28 Jun 2022, andrey100100...@gmail.com wrote: Thanks for the patch. It's just to play with it, note that onnote should be just passed once. I'll post another patch if things work ok. adr -- 9fans: 9fans Permalink:

Re: [9fans] syscall silently kill processes

2022-06-28 Thread andrey100100100
В Вт, 28/06/2022 в 15:28 +, adr пишет: > Andrey, if you want to use different note handlers per process (with > a big > number of processes) using libthread, this may be helpful. > > The idea is this: > > An array of handlers for all processes which can be changed by all > processes. > When

Re: [9fans] syscall silently kill processes

2022-06-28 Thread adr
On Tue, 28 Jun 2022, adr wrote: This just evade going through the arrays twice. For the current value of NFN it doesn't make too much a difference, note that this structures are locked. It just was hurting my eyes. Sorry for the noise, bad patch. --- /tmp/main.c +++ /sys/src/libthread/main.c

Re: [9fans] syscall silently kill processes

2022-06-28 Thread adr
On Tue, 28 Jun 2022, adr wrote: Andrey, if you want to use different note handlers per process (with a big number of processes) using libthread, this may be helpful. The idea is this: An array of handlers for all processes which can be changed by all processes. When a note is received by a

Re: [9fans] syscall silently kill processes

2022-06-28 Thread ori
Quoth adr : > Andrey, if you want to use different note handlers per process (with a big > number of processes) using libthread, this may be helpful. > > The idea is this: > > An array of handlers for all processes which can be changed by all processes. > When a note is received by a process,

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 11:38 AM adr wrote: > On Tue, 28 Jun 2022, Dan Cross wrote: > > You mean by `newthread` and `chancreate`? Those are part of the > > thread library. Notice that there are no callers outside of > > /sys/src/libthread. > > What I mean is that "size" in _threadmalloc() will

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Tue, 28 Jun 2022, Dan Cross wrote: You mean by `newthread` and `chancreate`? Those are part of the thread library. Notice that there are no callers outside of /sys/src/libthread. What I mean is that "size" in _threadmalloc() will be set by those functions with values directly given by the

Re: [9fans] syscall silently kill processes

2022-06-28 Thread adr
Andrey, if you want to use different note handlers per process (with a big number of processes) using libthread, this may be helpful. The idea is this: An array of handlers for all processes which can be changed by all processes. When a note is received by a process, this array takes priority.

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 10:22 AM adr wrote: > On Tue, 28 Jun 2022, Dan Cross wrote: > > [snip] > > Given the name of the function (`_threadmalloc`), I'd guess that this isn't > > intended for general use, but rather, for the internal consumption of the > > thread library, where indeed such a

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Tue, 28 Jun 2022, Dan Cross wrote: [...] void* _threadmalloc(long size, int z) { void *m; m = malloc(size); if (m == nil) sysfatal("Malloc of size %ld failed: %r", size); setmalloctag(m, getcallerpc()); totalmalloc += size; if (size >

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 9:01 AM adr wrote: > On Sun, 26 Jun 2022, adr wrote: > > [snip] > > /sys/src/libthread/lib.c > > > > [...] > > void* > > _threadmalloc(long size, int z) > > { > > void *m; > > > > m = malloc(size); > > if (m == nil) > > sysfatal("Malloc of

[9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Sun, 26 Jun 2022, adr wrote: Date: Sun, 26 Jun 2022 09:50:19 + (UTC) From: adr To: 9fans@9fans.net Subject: _threadmalloc() size>1; shouldn't be totalmalloc? /sys/src/libthread/lib.c [...] void* _threadmalloc(long size, int z) { void *m; m = malloc(size); if