TFE 支持 accept/worker 线程绑定 cpu

This commit is contained in:
luwenpeng
2020-07-28 16:43:37 +08:00
parent 4d7957e0cc
commit c82429c9d9
6 changed files with 87 additions and 4 deletions

View File

@@ -124,6 +124,10 @@ struct tfe_proxy
/* Crash Report */
struct breakpad_instance * breakpad;
/* cpu affinity */
unsigned int enable_cpu_affinity;
unsigned int cpu_affinity_mask[TFE_THREAD_MAX];
};
extern struct tfe_proxy * g_default_proxy;
@@ -137,3 +141,4 @@ void tfe_proxy_thread_ctx_release(struct tfe_thread_ctx * thread_ctx);
struct tfe_proxy * tfe_proxy_new(const char * profile);
int tfe_proxy_fds_accept(struct tfe_proxy * ctx, int fd_downstream, int fd_upstream, struct tfe_cmsg * cmsg);
void tfe_proxy_run(struct tfe_proxy * proxy);
int tfe_thread_set_affinity(int core_id);