Multiple users and thread management, how it works?

I was wondering if there is any clear documentation on how streamlit initializes and kills threads?

My understanding is that each connected user gets their own thread to serve content and process the code? Is this correct?

Is the operating system then in charge to allocate cpu time to each thread?

When does the server realize a user is no longer engaged with the application and kill the thread?

This is mostly relevant with regards to Heroku deployment since there is a maximum of 256 threads on the entry level dynos, which if I’m understanding correctly means that no more than 256 people could connect to a Heroku hosted streamlit site at one time?