????? ???? (?????? ??????) ???? Perl PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: ????? ???? (?????? ??????) ???? Perl


1
????? ????(?????? ??????)???? Perl
  • ???? ????
  • ????? Perl ??????

2
?? ?? ????? ?????
  • ????? ???? ???
  • ??? ?????? ??? ????? ?? ??? ?????, ?? ??????
  • ?????? ?????? ?????, ?????? ????? ?? ??????
    ?????? (?? ?? ????? ?? ?????)
  • ???? ????? ??????? ???? ????? ??????? ???? ???
    ?????? ??????? ?????? ???? ?????? ?? ????????
    ??????

3
?? ?? ??????? ????? ??????
  • ????? ?????? ???? ??? ????? ??? ???? ????? ???
    ????? ??? ??????. ??? ??, ????? ?? ???? ???????
    ????.
  • ?????, ?????? ???? ??????? ???? ??? ????? ???????
    ???? ????? ????? ???? ????? ?????? ??????. ?????
    ?? ??? ?? ???? ?????? ???? ?????? ???????
    (threads) ?? ?-exceptions.

4
?? ?? ??????? ????? ??????
  • ????? ??????? ??? ??? ????? ???? ?? ???? ??????,
    ??? ??? ???? ?????? ??? ????? ????? ???????
    ?????? ???????.
  • ????? ?? ???? ???? ??????, ???????, ???????,
    ??????? ?????. ??? ??? ???? ??????? "???? ???
    ?????? ?? ?? ????? ?????? ?????? ?? ???????"...

5
??? ????? ???? ??? ?????
  • ?? ?????. ??? ??????? ????????? ??????? ?????
    ???? ????? ?????? (?? ???? ??????) ?? ?????
    ?????? ?????? (????? malloc/free ?? new/delete).
  • ??? ?? ??? ?? ???? ?????? ????? ???? ?????
    ??????? ????? ????? "????? ??????" ?????? ???????
    ?? ????? ?????

6
??? ???????
  • ????? ???? ????? ???? ???? ???? ???? ??????
    ?????? ????.
  • ????? ???? ????? ????? ??????? ??? ??????? ????
    ?????? ?????? ???? ?? ????? ???.

7
??? ??????
  • ??? ?????????? ??? ?????? ???? ???? ??????? ?"?
    ???? ??? ??? ?? ???????. ???? ??? ?? ??? ??????
    ???? ??? 1.
  • ??? ?????????? ??? ?????? ???? ???? ?? ???? ????
    ???? ??? ???.
  • ?????? ????? ??????? ???? ?????? (???????? ?????
    ?????? ?????) ??? ????? ??????? ?????????
    ??????????.
  • ??????? ??????? ????????? ?????? ?? ?????
    ???????, ??? ?? ??????? ?????? ??????.
  • ????????? ?????? ?? ?????????? ?????? ??????,
    ?????? ???? ?????? ??????? ??????.

8
????? ????
  • ???? ????? ?????? ???? ??????? ???????? ??? ?????
    ????? ?????? ????? ?????? ?????? ?? ???, ??????
    ??? ????? ??? ?????.
  • ?????? ???????? ?????? ?????? ????? ????? ????.
  • Perl ???? ????? ?????? ????? ???? ?????? ?????.

9
?? ?? ?????
  • ???? ???? ?????? ???? ????? (??? ????? ???
    ??????? ????????), ???? ?????? ??? ??? ?? ????
    ??????, ????????.
  • (?? ???? ?? ??? ????...)

10
?? ?? ??????
  • ???? ?????? ?? ????? ?? ?????? ????? ????? ??
    Perl ?? ???? ????? ???? ???????.
  • ?????? ??? ???? ???? ??? ??? ???? ???????? ????
    ???? ??? ?? ?????? ???? ?? ??????.

11
????? ??????
  • ????? ?????? ???????? ?-Perl ???? ??? ??? "?????"
    ????? ?? ???? ??????? ????? ??????.

12
????? ?? ????? ??????
  • my a
  • a \a

13
????? ?? ????? ??????
  • my a
  • a \a

14
????? ????? ?? ????? ??????
  • my (a, b)
  • a \b
  • b \a

15
????? ????? ?? ????? ??????
  • my (a, b)
  • a \b
  • b \a

16
?? ?? ?? ????
  • ???? ??????? ???????, ???? ?-reference count ???
    ?? ?? ???.
  • ??? ?? ??? ?????? ????? ?????? ?????? ????, ???
    ??????? ???????? ??? ???? ?-reference count.

17
????? ????
  • ??????? ????? ?? ???? ??????? ??? ??? ???
    ???????
  • ????? ?? ????? ??? ???? ????? ????? ????
  • ?? ???? ????? ?? ?????? ???????? ???? ??? ??????
    ??? (??? ?? ??????? ?????? ?????? ??? ??????
    ?????? ?? ??????? ??? ???? ??? ?????? ??????)

18
????? ????
  • ??????? ????? ??????? ???? ?????? ?? ?????? ?????
    ????? ???? ???????? ???? ?? ??????? ???? ?????
    ????? ?????? ??? ?????? ???? ?? ????? ???? ???
    ???? ????? ??? ???? ??? ???? ??????? ?? ????
    ????? ?????? ????.
  • ????? ??? ????? ?????, ?? ?????? ????? ?????
    ????? ?? ???? ??????? ????? ??????? ??? ????
    ????? ??????, ??? ???? ????, ????? ?-?? ??????.

19
????? ???? ?-Perl
  • ?-CPAN ???? ????? ????? ??? WeakRef ??? ????? ?"?
    Tumas J. Lukka.
  • ??? ???? (?????? ?? core API) ???? ??????? ?????
    ?-Perl. ???? ???? ???? 5.005_55. ?????? ???? ????
    ???? ???? Perl ?????? ????? ??????? ?????.

20
WeakRef
  • use WeakRef
  • for (i0 ilt100000 i)
  • my x
  • my y
  • x-gtYy
  • y-gtXy
  • weaken(x-gtY)
  • no memory leak

21
????? ???? ?-Perl
  • ????? ??? ??? ??? ????? ??? ?-Perl ??? ??? ????
    ?????? ???? ?????? ???????? ?? ???? ???? ???
    ?????.
  • ??????? ???, ????? ?? ???????? ???? ????? ??
    ?????, ??????? ????? ?"? ???? ???? ??????
    ????????? ?????? ???? ???????? ???? undef.

22
????? ???? ?-Perl
  • ??????
  • use WeakRef
  • ?????? ??? ????? ????? ????? ?? ?????? ??????
    ???? weaken ?-isweak.
  • ?? ???? ?? ????? ??????? ???...

23
????? ???? ?-Perl
  • ?? ???? ?? ????? ?? ?????? ???????.
  • ?? ???? ?? ??? ???? ???? ????? ??? ?? ??? ?? ????
    ?????? ????? ????? ????.
  • ?"? ??????, ?? ????? ??? ????? ?????? ??????.

24
??????
  1. Programming Perl, third edition. Larry Wall, Tom
    Christiansen and Jon Orwant.
  2. GC FAQ draft. http//www.iecc.com/gclist/GC-faq.
    html
  3. WeakRef module on CPAN
  4. http//www.memorymanagement.org/
Write a Comment
User Comments (0)
About PowerShow.com