home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!uwm.edu!rutgers!faatcrl!iecc!compilers-sender
- From: tmb@idiap.ch
- Newsgroups: comp.compilers
- Subject: Re: Adding garbage collection to C++
- Keywords: C, GC
- Message-ID: <92-08-093@comp.compilers>
- Date: 17 Aug 92 16:04:23 GMT
- References: <92-08-092@comp.compilers> <92-08-076@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 22
- Approved: compilers@iecc.cambridge.ma.us
-
- bill@amber.ssd.csd.harris.com (Bill Leonard) writes:
-
- >[How do you garbage collect multi-threaded programs where some pointers to
- >shared memory are kept in per-thread private storage]
-
- > I think you basically have to give up on garbage collecting such strange
- > objects. But their existence forces me to advocate that garbage
- > collection only happen if I specifically ask for it (thus begging for
- > language extensions), rather than automatically.
-
- You don't need a language extension, nor do you need "garbage
- collection only [to] happen if [you] specifically ask for it". Simply
- retain a pointer to the object in the address space of A. In fact, you
- can encapsulate this behavior nicely inside your "send" procedure.
-
- Thomas.
- [So how do you ever collect storage that's ever been shared between two
- threads? In fairness, this isn't unique to C -- it'd be a problem in any
- situation where you have a shared heap with unshared pointers. -John]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-