You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An options API would be a good approach. Internally there could be a struct for various fields, one of the fields could be a cpu_set_t like member, which would define the core or core(s) that the NATS thread could run upon.
Something similar to the posix CPU_SET/CPU_ZERO would be needed to allow for cores to be added to it in a sensible way - wouldn't want people to having to deal with cores in terms of masks.
Here are some possible additions to the API:
Types: natsCoreSet
APIs:
The above would then have to be called before the NATs thread is created which would be before any natsConnection_Subscribe call is made, a possible example would be like so:
{
natsCoreSetcore_set;
natsConnection*conn=nullptr;
natsSubscription*sub=nullptr;
natsOptions_ClearCoreSet(core_set);
// NATS thread shall only run on cores 1,3 and 5natsOptions_AddCore(core_set,1)
natsOptions_AddCore(core_set,3)
natsOptions_AddCore(core_set,5)
natsOptions_ApplyCoreSet(core_set)
natsConnection_ConnectTo(&conn, nats_uri);
natsConnection_Subscribe(&sub, conn, subj, msg_handler, nullptr);
.
.
.
while (running)
{
}
}
The text was updated successfully, but these errors were encountered:
See https://natsio.slack.com/archives/C01AWP40KGF/p1684269701738519
An options API would be a good approach. Internally there could be a struct for various fields, one of the fields could be a cpu_set_t like member, which would define the core or core(s) that the NATS thread could run upon.
Something similar to the posix CPU_SET/CPU_ZERO would be needed to allow for cores to be added to it in a sensible way - wouldn't want people to having to deal with cores in terms of masks.
Here are some possible additions to the API:
Types:
natsCoreSet
APIs:
The above would then have to be called before the NATs thread is created which would be before any natsConnection_Subscribe call is made, a possible example would be like so:
The text was updated successfully, but these errors were encountered: