1

I have List<QueueItem> QueueItemList list of objects. I am filtering the objects list by object property Status and assign filtered list to processingList. If I will change object Status property in the QueueItemList list does it will be changed in processingList too?

        public List<QueueItem> GetItems()
        {
            lock (Locker)
            {
                return QueueItemList.ToList();
            }
        }

var processingList = GetItems.Where(p => p.Status== QueueItemStatus.Processing).ToList();

Getting hardware requirements for my application

Is there a way for me to get the amount of memory and processor power needed for my application. I recently had a very unpleasant experience when one of my applications kept freezing the computers on which it was working. This is obviously related to the lack of hardware power, because it works perfectly on the stronger computers that I used for testing purposes, where the application worked perfectly. So my question is - is there a way to calculate the amount of hardware power needed to run the application smoothly? Almost all of my applications are done in C#, so I would need a method that can work with that type of application. Thanks

4

4 に答える 4

2

QueueItemList リストでオブジェクトの Status プロパティを変更すると、processingList でも変更されますか?

QueueItemはい、値型 ( )でない限り、そうしますstruct。の場合、classそれは参照型です。つまり、 と の両方processingListQueueItemList、それらの要素に対してまったく同じメモリ位置を指していることを意味します。これらの変数は単なるポインターです。

于 2012-07-05T08:02:28.600 に答える
0

はい、同じオブジェクトへの参照がN 個あります。つまり、同じオブジェクトを変更することになります。

于 2012-07-05T08:03:32.510 に答える