daohu527 / dig-into-apollo

Apollo notes (Apollo学习笔记) - Apollo learning notes for beginners.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

回答cyber笔记中的疑问

DieYoungWsn opened this issue · comments

image

uint32_t pid = cr->processor_id();
这一句,processor_id默认值是-1(二进制位上全是1),但是赋值给无符号32位整型变量pid时,pid就是uint32_t的最大值(2^32-1),肯定要大于逻辑CPU(Processor)的数量的,所以入全局队列。