Company
Date Published
Author
Rodrigo Gomes
Word count
632
Language
English
Hacker News points
None

Summary

At SingleStore, developers were trying to solve a problem with obtaining the thread group identifier (`tgid`) using the `SYS_tgkill` Linux system call. They initially used a simple prototype that read from `/proc/self/status`, but it broke when newer Linux distributions added a new field to this file. The team investigated and discovered that the `tgid` was actually the same as the process ID (`pid`). By using the `getpid` system call directly, they were able to stabilize the tool and simplify the code, making it work on all environments tested.