???????????????APM??
???????????? ???????[ 2013/4/3 9:49:50 ] ????????
?????????????APM????.NET1.0?????????????????????????????????IAsyncResult???????
?????????????????????“.NET1.0?????????APM??”????????“.NET2.0?????????????”??“.NET4.X?????????????”????????????????????μ??????????????????“.NET4.0?????????????”??????????????????????????????????
????1?????Щ?????????????????????????????
????2???????????????????????????????????
????3???????????????????????????
????4?????…
??????????????????IAsyncResult????????.rar
????IAsyncResult?????----?淶????
???????IAsyncResult????????????????????? Begin*** ?? End*** ????????????????????????????????????????????????????磬FileStream????BeginRead??EndRead??????????????????????????????????? Read ?????????汾??
????????? Begin*** ????ó???????????????????????????????????????????????С???????з??????????? End*** ?????????????????
????1??Begin***
????a??Begin*** ???????и÷?????????汾????????????κβ?????
????b??Begin*** ????????в??????κ?????????????????????????????淶???????????????????AsyncCallback??У????????????????????????????????????????????????????????????????????????????????AsyncCallback??з?????????ó???????????????eg??????????????????з???End*** ???????????????????????????????null??
????c??????IAsyncResult????
// ???????????????
[ComVisible(true)]
public interface IAsyncResult
{
// ?????????????????????????????????????????
object AsyncState { get; }
// ???????????????????System.Threading.WaitHandle?????????????????????
WaitHandle AsyncWaitHandle { get; }
// ????????????????????????????ɡ?
bool CompletedSynchronously { get; }
// ???????????????????????????ɡ?
bool IsCompleted { get; }
}
// ???????????????????????????????????ref????????У?
public delegate void AsyncCallback(IAsyncResult ar)
????2??End***
????a??End*** ???????????????????????? End*** ???IAsyncResult????????????????δ?????? End*** ???????????????????????????
????b??End*** ????????????????????????????????????End*** ???????и÷???????汾?????????????????out ?? ref ?????????BeginInvoke?????IAsyncResult???淶?? IAsyncResult ???????
????i. ????÷????????????????????
????ii. ?????out ?? ref ????????????????????out ?? ref ??????????????л??????????????????????
?????????????????IAsyncResult??????????淶?????????????????IAsyncResult????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11