In our application we have a Queue which is defined as the following:
private static Queue RawQ = new Queue();
Then two different types of objects are put onto the Queue, one are objects from a class (class A) and one are objects from a struct (struct B).
When we process the data from the Queue, we use typeof to check the item from the Queue belongs to which type (class A or struct B).
My questions:
- for objects from class A, only their references are copied to the Queue and for object from struct B, their values are copied to the Queue, am I right?
- for a Queue, some items are references which is small and some items are values which are much bigger (about 408 Bytes). This will waste many memory space if the Queue is not small?
- do you have a better way to do the same thing?
thanks,