isc__tid_initcount() in isc_loopmgr_create() prevents creating new loopmgr
I am not sure if this is a bug or intention.
bc2389b8 introduced isc__tid_initcount()
[1] that is called in isc_loopmgr_create()
[2]. isc__tid_initcount
allows one time initialization of tid_count
. If it is already initialized, it is no longer possible to create new loopmgr, thus it enforces single loopmgr per application.
At the very least, this renders Every application is expected to create and use a single isc_loopmgr_t instance, but the isc_loopmgr API itself doesn't enforce this requirement.
[3] not true.
It is also possible to workaround this by passing isc_thread_count()
to isc_loopmgr_create()
, but I believe this is not intentional.
We are currently working on changing bind-dyndb-ldap for bind 9.20, and we would like to use a new loop manager running in separate thread, i.e. isc_loopmgr_create(mctx, 1, &loopmgr);
. I would like to know what is the intentional behavior so we can decide what to do next.
[1] https://gitlab.isc.org/isc-projects/bind9/-/blob/main/lib/isc/tid.c#L45 [2] https://gitlab.isc.org/isc-projects/bind9/-/blob/main/lib/isc/loop.c#L379 [3] https://gitlab.isc.org/isc-projects/bind9/-/blob/main/doc/dev/loopmgr.md?plain=1#L20