MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / connSetThreadAffinity

Function connSetThreadAffinity

src/connection.cpp:458–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458void connSetThreadAffinity(connection *conn, int cpu) {
459#ifdef HAVE_SO_INCOMING_CPU
460 if (setsockopt(conn->fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, sizeof(cpu)) != 0)
461 {
462 serverLog(LL_WARNING, "Failed to set socket affinity");
463 }
464#else
465 (void)conn;
466 (void)cpu;
467#endif
468}
469
470/* Return a text that describes the connection, suitable for inclusion
471 * in CLIENT LIST and similar outputs.

Callers 1

clientAcceptHandlerFunction · 0.85

Calls 1

serverLogFunction · 0.85

Tested by

no test coverage detected