Giving a Queue a Unique Id and Name

I am looking to give my Queues a unique Name (a String) and unique ID (an int or other number).. Is this possible as I would really like to track/manage my queues.
Who is Participating?
2266180Connect With a Mentor Commented:
you have at least 2 options, but none of it is ... perfect.
1) extend the Queue class and add the necessary fields.
2) use a hashtable or something like that in which you add either the ID or an object with the necessary fields

class MyQueue : Queue{
  public int ID;
MyQueue q = new MyQueue();
q.ID = ID;
2) HashTable t;
you have a variaty of possibilities. for example, just incrementing a number will give a unique number and the limit is pretty high (for an long it 2^64-1)
for a name, you can also use the ID and maybe something like "Queue" + ID;
or if you want something unique accross machines, you can use GUID's
directxBOBAuthor Commented:
ok but if I have

Queue myQueue = new Queue();

how do I give it a unique ID?

for example if I am passing in a string for a hashtable ID how do I tack that string on so it becomes the unique ID for the
directxBOBAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.