Doubts about the use of threadlocal as session Management

multiple requests from a user are most likely not in the same thread. Suppose the first request is thread A, which is stored in threadLoacl. The second request is thread B. isn"t it impossible to get the session of the first request from the current thread? Or maybe user 1 requests the service first and puts the session in the threadlocal of thread a, and user 2 also uses this thread, and user 2 stores the session in the threadlocal of thread a, doesn"t it overwrite the session pollution of user 1?

Aug.18,2021

just

  1. each request is completed in one thread
  2. set the threadLocal correctly at the beginning of every other request and clear the threadLocal correctly at the end of the threadLocal,

is fine


this article is easy to understand. Recommend it:
https://www.ixigua.com/6872736339528417792/

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf546f-144a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf546f-144a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?