We have wish, but I believe it is beyond a 101 course.
It has to do with bdwgc running concurrently.
We use bdwgc in our prolog runtime system.
Unfortunately it doesnât give the speedups we had hoped for if we run algorithms concurrently.
The problem seems to be that typed allocations havenât been optimised for concurrency. (typed allocations arenât moved to thread local storage).
If we make an experiment where we use untyped allocations (nonatomic) then we get reasonably speedups, not brilliant but much better than if we use type allocations.
So improving concurrent behaviour (we are on a win32 platform) is on the wishlist.
But it is probably also beyond a CS101 course.
But then again figuring out what the problem is might be within the scope.
Carsten Kehler Holst
Prolog Development Center
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Bruce Hoult
Sent: 19 March 2015 03:53
To: Henryk Michalewski
Subject: Re: [Gc] A student assignment based on bdwgc
I think it's an excellent idea to introduce students to C programming using a garbage collector. Many professional programmers don't seem to realize that GC is not a convenience reserved to programmers using Java or Python. Using C with GC is much more pleasant (and safe!) than using C with malloc/free.
I don't think it's realistic to have CS101 students modify bdwgc. Graduate students or advanced undergrads maybe, but it would be an extraordinary first year student who could be successful.
However simply reading some of the code may be instructive. Bdwgc is a software library that has existed in some form for nearly THIRTY years! See:
Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment", Software Practice & Experience, September 1988, pp. 807-820.
Boehm, Hans-J., Alan J. Demers, and James E. Donahue, ââA Programmerâs Introduction to Russellââ, Technical Report 85-16, Computer Science, Rice University, 1985
Most of the description in the first paper still applies. There are some changes, for example the block header information has since been taken out of the blocks, and fewer distinct object sizes are supported (object requests are rounded up to the next larger size). However the basic principles still apply.
Over the last 25 or so years bdwgc has been ported to a vast number of different operating systems. It may be instructive for students to see how differences between the different machines have been coped with in real production code (largely by macros and conditional compilation).
I don't think there is much of a wish list for bdwgc. The gc code itelf been pretty well optimised and debugged over the last 25 years.
There is room for additional facilities for debugging. For example dumping various descriptions of the heap, or explaining why a particular object can't be collected. That kind of thing. That might be within reach of a good student.
One thing I'd personally like is to see it usable on smaller machines. In a previous life I used it on mobile phones with as little as 400 KB of RAM, and the fact that it had (from memory) about 150 KB of statically allocated global arrays was pretty annoying. I got that down to I think about 15 KB, but unfortunately I wasn't allowed to distribute that code, and don't have access to it any more anyway.
I'd love to be able to use GC in programming microcontrollers such as the Arduino. Unfortunately, you'll never fit bdwgc into something with 2 KB of RAM. But creating a new GC suitable for such uses might be a good project. Some of the ideas in the "Chicken" Scheme compiler might be useful.
On Wed, Mar 18, 2015 at 1:02 PM, Henryk Michalewski <***@gmail.com<mailto:***@gmail.com>> wrote:
I am running a CS 101 class at the CS department of the University of
Warsaw. This class is focused on the C language. I like the idea of
making a student software project based on bdwgc and contemplated
options such as
- implementation of alternative gc algorithm
- some optimizations/improvements in the current code
- building an additional tool conceptually related to bdwgc
The final project should not exceed 2000-3000 lines.
Maybe this is a stupid idea in the sense that in your view this is a
too tough assignment - please feel free to inform me about it.
Otherwise, I would be glad to hear some specific recommendations from
Yours, Henryk Michalewski
bdwgc mailing list
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
This message has been scanned for malware by Websense. www.websense.com