[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Giving a Queue a Unique Id and Name

Posted on 2006-06-12
4
Medium Priority
?
235 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 2000 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 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