How to deal with deadlock.

本文探讨了在创建 SharePoint 类时遇到的内存死锁问题,详细描述了一个由于 FPWeb 和 FPListCollection 类之间的循环引用导致无限递归创建对象并最终耗尽内存的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

      When I pack the SharePoint class into my new framework I meet a deadlock. It  uses my memory up. The following is details.

       I created a class FPWeb, and it has a property of "Lists", which represents a FPListCollection object which contains all the list in the current web. And in class FPListCollection I write a property of ParentWeb which is a FPWeb type and represents the web which the current list object belongs to. So the problem comes out:

      When I creat a FPWeb object I should creat the Lists whose type is FPListCollection first. And When I creat the Lists, I should creat the ParentWeb whose type is FPWeb first. So I creat the ParentWeb, which means I should creat the Lists again~. Obviously, I creat and creat with no end. Quickly, my memory is used up.

      So this is my deadlock, what should I do to deal with it? This is a headache problem.

        Related Code.

  

        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值