Chris Knadle wrote:
On Monday, February 04, 2013 22:21:11, Adam wrote:
I thought anything in C was reentrant, because of C's passing
parameters on the stack (and other features designed into the
compiler).
No, C is not automatically reentrant. The issue is that functions can have
local variables; non-dynamic local variables have memory locations that are
chosen at compile time rather than at run time.
Okay, I see. So then one can design C functions to be reentrant by
avoiding non-dynamic local variables (and a few other structures... or
it's easier to write reentrant code in C than in some other languages.
I get the same response from 'ldd', but GIMP still uses only one core at
a time on my system.
This goes back to what Sean had mentioned, concerning applications not being
able to take advantage of multiple cores well. i.e. "possible" != "great".
So having multiple cores won't make GIMP run any faster, but it does
mean I can run both GIMP and another CPU-intensive program and both will
run nearly as fast as if they were the only program running.
BTW I'm not complaining about GIMP, just curious. When I'm manipulating
large images (which isn't often), the quality of the result is much more
important than the speed.
our biggest assignment was the ubiquitous "dining philosophers" which
required five concurrent invocations of Philosopher().
This is the first I've heard of the "Dining Philosophers" problem, but I found
a reference to it:
https://en.wikipedia.org/wiki/Dining_philosophers_problem
Yep, that's the one. I'm sure you can see why it would be appropriate
for a class in concurrent programming. I don't see the "solution" we
were told to use on that page, though -- one of the philosophers starts
off by looking in the opposite direction from the others. For example,
start by trying to get the fork on the right, unless it's philosopher #2
who starts by trying to get the fork on the left.
Any guesses, anybody, on whether some future programs are going to be
written to take advantage of multiple cores?
Adam
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) Vassar College
Feb 6 - Raspberry Pi
Mar 6 - 10th Anniversary Meeting - Linux where you least expect it
Apr 3 - Typography: Physical Art to Digital Art