Solved

Giving a Queue a Unique Id and Name

Posted on 2006-06-12
4
225 Views
Last Modified: 2008-03-04
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.
0
Comment
Question by:directxBOB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 16891991
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
0
 

Author Comment

by:directxBOB
ID: 16898587
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
0
 

Author Comment

by:directxBOB
ID: 16898590
Queue
0
 
LVL 28

Accepted Solution

by:
2266180 earned 500 total points
ID: 16900247
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

examples:
1)
class MyQueue : Queue{
  public int ID;
}
MyQueue q = new MyQueue();
q.ID = ID;
2) HashTable t;
t.Add(myQueue,ID);
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question