How to maintain a pool of names ?

Posted by Jacques René Mesrine on Stack Overflow See other posts from Stack Overflow or by Jacques René Mesrine
Published on 2010-04-27T06:15:34Z Indexed on 2010/04/27 6:23 UTC
Read the original article Hit count: 266

Filed under:
|
|
|
|

I need to maintain a list of userids (proxy accounts) which will be dished out to multithreaded clients. Basically the clients will use the userids to perform actions; but for this question, it is not important what these actions are. When a client gets hold of a userid, it is not available to other clients until the action is completed.

I'm trying to think of a concurrent data structure to maintain this pool of userids. Any ideas ? Would a ConcurrentQueue do the job ? Clients will dequeue a userid, and add back the userid when they are finished with it.

© Stack Overflow or respective owner

Related posts about java

Related posts about design