Jump to content

Common Lists?


davej
 Share

Recommended Posts

So if I wanted to supply a common list of users who are logged in to all users what is the most efficient approach? A static class with a static arraylist? A small table in the database? Something else? Thanks

Link to comment
Share on other sites

Since the data needs to persist between requests, while being the same for all users, a database table seems not simply the best, but pretty much the only solution.

Link to comment
Share on other sites

Well, it seems that static variables might be an alternative, but there is a concern about "thread safety" which is over my head. Setting or clearing a particular boolean in a static array might be thread safe but I would have doubts about using an arraylist or string or any multi-byte variable.

Edited by davej
Link to comment
Share on other sites

Last I checked, similarly to PHP, ASP.NET re-executes your whole code (the only difference from , say PHP, is that the code is compiled on first access), so a static variable wouldn't work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...