« Win32 API と .NET Framework の対応置き換えマップ | Main | .NET GC & Interop クイズ解答編 »

2004.03.05

.NET GC & Interop クイズ

GC と Memory Leak の件はやはりフレームワークのバグで、KB の処置を施したら直った。以前は一日走らせていると100MB程度までメモリを食っていたのが、すっきりと直った。すっきりと直ったので、一週間ほど休暇をとることにした。
ので今日は休暇の前にちょっとプログラミングのクイズ。Interop で OS から handle を取得してラップするクラスがあるとする。
public class Wrapper : IDisposable {
  IntPtr _handle;
  public Wrapper(IntPtr handle) { this._handle = handle; }
  public ~Wrapper() { this.Dispose(); }
  public void Dispose() {
    GC.SupressFinalize(this);
    if (this._handle != IntPtr.Zero){
      NativeMethod.CloseHandle(this._handle);
      this._handle = IntPtr.Zero;
    }
  }
  public void Work() {
    NativeMethod.WorkOnHandle(this._handle);
  }
}
このクラスはある特定の条件で動作しない。その条件と直し方は?
GC などで言語やランタイムが簡単になると、それより下のレイヤーと強調して動くのはそれまでよりも難しくなる。それは仕方のないことか、それとも GC がもっとこなれてくるまでの移行期間の問題なのか、10 年後にこんな問題を考えて対処していたことをどう思うか楽しみでもある。

|

« Win32 API と .NET Framework の対応置き換えマップ | Main | .NET GC & Interop クイズ解答編 »

Comments

Howdy excceptional website! Does running a blog similar too this take a great deal of work? I have vrtually no expertise in coding but I was hoping to start my ownn blog in the near future. Anyways, if you have any recommendations or tips for new blog owners please share. I understand this is off subject however I simply needed to ask. Many thanks!

Posted by: lace dresses | 2013.12.01 at 06:26 PM

You should be a part of a contest for one of the best sites online. I most certainly will highly recommend this website!

Posted by: www.bluetoothspeakersreviewer.com | 2013.12.03 at 04:45 AM

Hi there, I discovered your blog by the use of Google at the same time as searching for a related matter, your web site got here up, it appears good. I've bookmarked it in my google bookmarks. Hi there, simply become alert to your weblog via Google, and found that it is really informative. I am going to be careful for brussels. I will appreciate if you continue this in future. A lot of other folks might be benefited out of your writing. Cheers!

Posted by: lace dress | 2013.12.03 at 07:08 AM

Whatt a stuff of un-ambiguity and preserveness of valuable knowledge on the topic of unexpected emotions.

Posted by: red dresses | 2013.12.03 at 07:27 AM

Fantastic beat ! I wish to apprentice while you amend your website, how can i subscribe for a weblog site? The account aided me a appropriate deal. I had been a littlee bitt familiar of this your broadcastt provided vibrant transparent concept

Posted by: designer handbags | 2013.12.19 at 05:01 AM

It's wonderful that you are getting ideas from this piece of writing as well as from our discussion made at this time.

Posted by: www.babycribsgiant.com | 2013.12.21 at 10:51 PM

Way cool! Some extrsmely valid points! I appreciate you writin this post and also thee rest of the siite is also really good.

Posted by: http://www.onlycocktaildresses.com/ | 2013.12.26 at 05:08 AM

Normally, credit score is accustomed to measure the trustworthiness of the applicant, so lenders understand each time a job loss upsets matters, making unemployment loan approvals likely justin timberlake 2014 tour dates (http://Justintimberlaketix2014.com) they are already developing and testing eight high class websites and packages to create on the public.

Posted by: http://Justintimberlaketix2014.com | 2014.03.01 at 05:45 PM

Choose a live-chat function to the online store, when you have questions while shopping. Do a quick seek out promotional requirements, before you go shopping at any online retailer.

Posted by: Nickolas | 2014.03.28 at 10:53 AM

Some sites offer major discounts, free shipping, or equally on breaks. It could be quite easy to locate just what you want at the right price online. Online shopping can really provide many benefits.

Posted by: Amie | 2014.03.31 at 10:12 PM

Do you feel you know more about onlineshopping now that you have read this informative article? Having a free account may also enable you to keep an eye on your requests and earnings superior to not having one.

Posted by: Milan | 2014.04.01 at 07:07 AM

This easy game about fighting appeared to have a secret power to bring people into just one more game. It's among the earliest arcade gaming released in the year 1972. Great for few basic editing work.

Posted by: Jed | 2014.04.07 at 03:44 PM

You'll find card games, Bible games, Disney games, family games, puzzle games, gaming publications and adult games. LEGO INDIANA JONES [Xbox/PS3/PS2/PC/Wii/PSP/DS] - You had me at Lego.

Posted by: Solartechnik123.de | 2014.04.10 at 09:33 PM

I am curious to find out what blog platform you are working with? I'm experiencing some minor security problems with my latest blog and I'd like to find something more risk-free. Do you have any solutions?

Posted by: terry towelling beach dress | 2014.05.10 at 05:19 PM

Thanks for your marvelous posting! I truly enjoyed reading it, you're a great author.I will remember to bookmark your blog and will come back later on. I want to encourage you continue your great writing, have a nice holiday weekend!

Posted by: wrap dresses ireland | 2014.05.18 at 09:26 AM

Greetings! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us useful informstion to work on. You have done a marvellous job!

Posted by: blue dresses on sale | 2014.06.08 at 07:22 AM

It's a pity you don't have a donate button! I'd definitely donate to this superb blog! I guess for now i'll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will talk about this site with my Facebook group. Chat soon!

Posted by: young womens dresses | 2014.06.10 at 09:19 PM

Hey! I know this is kinda off topic however , I'd figured I'd ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa? My sitte addresses a lot of the same toppics as yours and I feel we could gratly benefit from each other. If you're interested feel free to send me an e-mail. I look forward to hearing from you! Superb bblog by thhe way!

Posted by: yellow tube dress | 2014.06.16 at 01:46 AM

It is actually a great and useful piece of info. I am happy that you just shared this helpful information with us. Please stay us informed like this. Thanks for sharing.

Posted by: ヴィヴィアン ウエストウッド バッグ | 2014.06.26 at 08:41 AM

If you are going for finest contents like I do, simply visit this web site daily because it offers feature contents, thanks

Posted by: Eleanore | 2014.09.06 at 06:37 AM

This is my first time pay a quick visit at here and i am in fact pleassant to read all at alone place.

Posted by: Caribbean-cruise | 2014.09.08 at 09:38 PM

Hurrah, that's what I was exploring for, what a stuff! present here at this website, thanks admin of this web site.

Posted by: vacation | 2014.09.09 at 01:47 AM

It's very straightforward to find out any matter on web as compared to textbooks, as I found this piece of writing at this site.

Posted by: fifa 15 ios free | 2014.12.26 at 09:04 AM

My spouse and I absolutely love your blog and find the majority of your post's to be precisely what I'm looking for. Do you offer guest writers to write content in your case? I wouldn't mind writing a post or elaborating on some of the subjects you write regarding here. Again, awesome site!

Posted by: plus size ball gown wedding dresses | 2014.12.30 at 09:04 AM

I love what you guys are up too. This sort of clever work and coverage! Keep up the great works guys I've incorporated you guys to our blogroll.

Posted by: fifa 15 360 | 2015.01.01 at 11:27 AM

When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks a lot!

Posted by: fifa 15 ps3 | 2015.01.01 at 04:30 PM

Hi, all the time i used to check website posts here early in the dawn, for the reason that i love to find out more and more.

Posted by: fifa 15 ios free | 2015.01.08 at 09:02 PM

magnificent put up, very informative. I'm wondering why the opposite experts of this sector don't realize this. You should continue your writing. I'm sure, you've a huge readers' base already!

Posted by: http://intensedebate.com | 2015.01.08 at 10:47 PM

I'm very pleased to uncover this great site. I want to to thank you for your time for this wonderful read!! I definitely really liked every little bit of it and I have you book-marked to check out new things in your web site.

Posted by: fifa 15 xbox 360 | 2015.01.09 at 01:33 AM

Hi my friend!I wish to say that this post is awesome, nice written and include approximately alll significant infos. I would like to peer more posts like this .

Posted by: precious metals ira | 2015.02.20 at 10:33 PM

Hi there to all, the contents present at this weeb site are genuinely awesome for people experience, well, keep up the nice work fellows.

Posted by: 401k rollover advice | 2015.04.17 at 07:06 AM

I am really inspired together with your writing skills as neatly as with the format to your weblog. Is this a paid subject or did you modify it yourself? Either way keep up the nice quality writing, it's rare to look a nice blog like this one nowadays..

Posted by: http://trifuelgenerators.net/benefits-owning-tri-fuel-generator/ | 2015.04.18 at 06:51 AM

Remarkable issues here. I'm very satisfied to look your article. Thanks sso much and I'm taking a look forward to touch you. Will you kindly drop me a e-mail?

Posted by: Jacques | 2015.05.09 at 07:11 PM

Howdy this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if yoou have to manually code with HTML. I'm starting a blog soon but have no cokding expertise sso I wanted to get guidance from someone with experience. Any heop would be enormously appreciated!

Posted by: sites.google.Com | 2015.05.17 at 01:58 PM

With havin so much content annd articles do you evdr run into any issues of plagorism or copyright violation? My website has a lot of exclusive content I've either written myself orr outsourced but it looks like a llot of it is popping it up all over the internet without my agreement. Do you know any techniques to help reduce content from being stolen? I'd genuinely appreciate it.

Posted by: mental-yoga.org | 2015.05.31 at 07:34 AM

Thankfulness to my father who told me about this weblog, this blog is genuinely awesome.

Posted by: warts home | 2015.06.27 at 08:02 AM

Hi, I do believe this is an excellent site. I stumbledupon it ;) I will revisit once again since i have bookmarked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

Posted by: cheap hosting | 2015.06.29 at 06:40 PM

Pretty element of content. I just stumbled upon your web site and in accession capital to assert that I get actually loved account your blog posts. Anyway I'll be subscribing on your feeds or even I achievement you access persistently quickly.

Posted by: Genital warts Completely | 2015.07.02 at 08:52 AM

Coveredd contact possibilities will increased cash flow.

Posted by: binary options trading hours | 2015.07.19 at 05:06 AM

硬碟醫院硬碟救援資料第一時間送來有高成功率,並有北中南業者無法救出而轉送成功眾多案例,如台灣微軟張經理送淩威科技2次救援,特力屋商品部朱經理,德商西門子吉悌等,專業設備和13年以上專業工程師搶救你寶貴Naѕ,硬碟救援資料

Posted by: 拯救硬碟 | 2015.07.22 at 10:26 AM

I think the admin of this website is truly working hard in favor of his web page, as here every data is quality based material.

Posted by: wart cheaply | 2015.08.09 at 04:18 AM

Good post however I was wondering if you could write a litte more on this subject? I'd be very thankful if you could elaborate a little bit more. Kudos!

Posted by: genital warts remedies | 2015.08.16 at 12:13 PM

Hello! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing a feew months off hard work due to no backup. Do yyou have any methods to protect against hackers?

Posted by: Jesenia | 2015.09.01 at 09:33 AM

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Posted by: Madden Mobile Hack | 2015.09.14 at 12:30 AM

' You are the treasure that I have been looking for. Western guys wish to have beautiful Asian ladies as their partners because of these reasons. Polish singles plan to show off their particular feminine sides and are not afraid to be who they unquestionably are.

Posted by: attract girls | 2015.10.10 at 08:13 PM

Une recharge de CO2 vous offre la possibilite de transformer 60 litres d'eau en soda gourmand et gazeux : vous faites ainsi toujours plus d'economies !

Posted by: machine a soda moulinex ju385h10 | 2015.10.17 at 02:35 PM

Thank you a lot for sharing this with all folks you actually understand what you are speaking about! Bookmarked. Please also talk over with my website =). We can have a hyperlink change contract among us

Posted by: high PR backlinks | 2015.10.21 at 07:26 AM

Very soon this site will be famous amid all blogging and site-building people, due to it's pleasant articles

Posted by: write my essay | 2015.10.21 at 03:56 PM

A conservative, religious woman, I could see her mouth pursed in disapproval. A vital part of learning how to write essays is to understand the importance of structure. This is not to do with the typical senile lamenting that the grass was greener and the beer was cheaper far long ago, but it's quite the fact supported by historical data.

Posted by: Writing Papers | 2015.10.23 at 10:09 AM

Awesome website you have here but I was wondering if you knew of anyy message boards that cover the same topics talked about in this article? I'd really like to be a part oof ggroup where I can get opinions from other experienched idividuals that share thhe same interest. If you have any suggestions, please let me know. Cheers!

Posted by: direct rollover | 2015.10.23 at 01:37 PM

This same precept refers to format of affiliate and on-line merchant, solely in this case the affiliate would be you and the relort company and pop group can be the merchant who has put all the items in place for you to show the purchasers.

Posted by: making money | 2015.10.25 at 03:08 AM

First of all I want to say great blog! I had a quick question which I'd like to ask if you do not mind. I was curious to find out how you center yourself and clear your thoughts prior to writing. I have had a hard time clearing my thoughts in getting my ideas out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes tend to be wasted just trying to figure out how to begin. Any recommendations or hints? Thank you!

Posted by: home wart removal | 2015.11.06 at 04:37 AM

With havin so much content do you ever run into any issues of plagorism or copyright violation? My site has a lot of exclusive content I've either created myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement. Do you know any methods to help stop content from being stolen? I'd definitely appreciate it.

Posted by: effective home remedy | 2015.11.16 at 11:09 AM

Post a comment



(Not displayed with comment.)




TrackBack

TrackBack URL for this entry:
http://app.cocolog-nifty.com/t/trackback/2111/266998

Listed below are links to weblogs that reference .NET GC & Interop クイズ:

» .NET GC & Interop クイズ解答編 [さすらいのプログラマー]
.NET GC & Interop クイズ の解答。 問題は Work メソッド内にある。Work メソッドが NativeMethod.WorkOnHandl... [Read More]

Tracked on 2004.03.14 at 08:00 AM

» [.NET]それが SQL Server Quality (2) [NyaRuRuの日記]
「信頼性」が問われる実装例として,さすらいの .NET プログラマーさんの ”.NET GC & Interop クイズ” から引用((タイムリーにSa... [Read More]

Tracked on 2005.03.20 at 07:04 PM

» .NET GC&Interop クイズ [菊池 Blog]
.NET GC&Interop クイズ [Read More]

Tracked on 2005.03.22 at 10:44 AM

« Win32 API と .NET Framework の対応置き換えマップ | Main | .NET GC & Interop クイズ解答編 »