C++ standards for thread management

C

Chris Thomasson

[...]
I think also that the standard should be more specific about the use of
function statics. i.e.

void function()
{
static T t = expression;
}

If "function" is called simultaneously by 2 threads, expression should be
evaluated exactly once and if the initialization of t is being done by
"thread 1" then "thread 2" should wait until the initialization is
complete.
{
__thread static T t = expression;
}

Here, the "t" initializer is called once per thread.

[...]

IMHO, I think I happen to have a pretty good solution to this particular
"aspect" of C++. I will be adding the rest of the information to my rough
draft of a paper I am currently creating which deals with this exact issue:

http://appcore.home.comcast.net/vzdoc/atomic/static-init/



I will show how to build a complete library, step-by-step, that will be able
to directly address the "multi-threading / C++ statin initialization issue"
by adhering to the following basic logic:


((atomic-op/membar)+(C POD)+(Static-C++ Template)

= { atomic statically initialization of c++ objects'};




The basic algorithm will be added to the paper over the next couple of days.
FWIW, I actually posted a crude working version (e.g, after you apply
correction to pseudo-code) of the reference counting algorithm I developed
over on the Boost developer list; still no real response --

;^(...


However, IMHO at least, they should be happy to implement and test the hell
out of my invention, and possibly see for themselves that it can work out
for well...



This is currently implied by the standard that says the initialization of
t must occur once but that requirement should be clarified in the event of
the standard becoming "thread aware". Plenty of discussion around this
"bug" can be found in the gcc bug list. I believe that since gcc 4.0, it
guarentees this for threaded code. I don't recall any other compiler
(besides gcc) guarenteeing this yet.

The initialization of the static C++ object(s) can, and will be freely, and
concurrently, invoked by multiple threads. The objects will start to freely
flow through; many constructors/destructors will have to orchestrated. Also,
the memory that makes up the objects that own those destructors will have be
meticulous tracked, and the dtor called at 'only when the memory is
"quiescent" '...
^^^^^^

[...]



These comments are just from a cursory look at the boost API. I think
there are some serious deficiencies in this proposed thread API and I'd
like to see some more analysis before it gets committed to the standard.

In addition to the rough draft on static-init, I have provided Boost with a
prototype of a mostly lock-free atomically thread-safe reference counting
algorithm:

http://appcore.home.comcast.net/vzoom/refcount/



Any comments on what I am trying to help Boost out with?


I agree with you that impotents can made, here and there...

;^)


Any thoughts/comments on this stuff at all, anybody??


thank you all for your kind patience...

;^)
 
C

Chris Thomasson

Pete Becker said:
Joe said:
Seriously, the hardware is advancing at a faster rate than software
[...]

I don't know how to write code that will scale to 100+ core processors,
much less what standard language support for it ought to look like. But
from the three-day special meeting we had in Redmond last month, which
included representatives from several hardware manufacturers as well as
people with far more experience writing multi-threaded code than I have, I
don't think anyone else does, either.

[...]


http://groups.google.com/group/comp.programming.threads/browse_frm/thread/b192c5ffe9b47926

http://groups.google.com/group/comp.programming.threads/msg/5d9d09da93024a1c

http://groups.google.com/group/comp.programming.threads/msg/a74cbaf6d57ed22b


100 processors is no problem.
 
C

Chris Thomasson

amortized virtually zero-overhead PDR techniques' scale to thousands of
cores, and beyond.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top