Yes, /proc “contains” directory entries for thread identifiers as well as process identifiers, but only the latter are enumerated by getdents, so ls only shows process identifiers. This is described in man 5 proc, in the “Overview” section, since release 5.00 of the man-pages project:
/proc/[pid] subdirectories
The /proc/[pid] subdirectories are visible when iterating through /proc with getdents(2) (and thus are visible when one uses ls(1) to view the contents of /proc).
/proc/[tid] subdirectories
The /proc/[tid] subdirectories are not visible when iterating through /proc with getdents(2) (and thus are not visible when one uses ls(1) to view the contents of /proc).
Why is that?
I suspect it’s to preserve backwards-compatibility (for programs written before threads existed in their current form on Linux), and to limit scalability problems.
Can I access with C code directly with tid? /proc/1235/mem without know the process id?
Yes, if you know the tid you can access /proc/${tid} directly, without going through the pid.
If you want to enumerate threads, you can list the directory entries under /proc/${tid}/task/ (this works with any thread identifier, not just process identifiers).