Jump to content

Common Lists?


davej

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...