473,508 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Some quick c++ memory-model concerns...

[...]

<wk****@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
>
kanze wrote:
>wk****@yahoo.com wrote:
.
[...]
>An important consideration is being able to the guarantee order
some set of writes becomes visible to other threads. But it's
part of the larger problem of the memory model in general.

I talked about that in the part you didn't quote. When
I say "observable read/write" I guess I need to clarify this
means like a read/write of a volatile variable. I think the
Standard does require that the order (as determined by
sequence points) be preserved.
volatile has nothing to do with the memory model... Well, except in
Microsoft...

http://groups.google.com/group/comp....2d229061?hl=en

http://groups.google.com/group/comp....fbe7472d229061

I hope that volatile does not become so strict that is rendered useless...

The definition of "observable behavior" in the current
Standard should be fleshed out, but I think it will
always be somewhat open-ended. Maybe the
comparison is with the number of bits in an int,
with a minimum but no max, just a requirement
that you say what it is. If a compiler assets that
it supports multi-threading of a given type, all
threads must "properly see" each others
observable reads/writes.
I would not use that compiler... That sounds more strict than Java memory
model:

http://groups.google.com/group/comp....54919230?hl=en

http://groups.google.com/group/comp....89ee4e7f?hl=en

:O

If a compiler targets
a multi-core processor without implicit
cache synchronization,
Huh?

the doc should say when/
whether it's going to generate the explicit
cache flushes/invalidates for the cores to
pass data between themselves.
Ahhh... Okay...

Anytime somebody talks about the cache wrt the memory model... Well:

http://groups.google.com/group/alt.w...0139360ffbf4e2
http://groups.google.com/group/comp....3df394a0370fa6
http://groups.google.com/group/comp....3df394a0370fa6
(read all, BTW I was SenderX)

Here is some of my quick thoughts on the subject:

http://groups.google.com/group/comp....2f1af4552233df

http://groups.google.com/group/comp....d850d47125a2b8

I hope the memory model c++ finally go with is compatible with lock-free
reader patterns:

https://coolthreads.dev.java.net/ser...essageID=11068

http://groups.google.com/group/comp....30da4289ee4e7f
(Yikes! Not good; for me at least...)
I have grave concerns about the negative impact that "overly
strict/paranoid" memory models can have on advanced thread synchronization
techniques. IMHO, it would be really neat for C++ to have efficient and
flexible support for this kind of stuff:
http://groups.google.com/group/comp....1506fb6d0e3ba7
I am looking forward to see what c++ come up with; One quick piece of advice
: Please don't let c++ memory model turn into a behemoth; think of poor
java... I can't implement my vZOOM library on Java. It could be done with
Java volatiles, however IMHO it would simply be big a waste of my time and
energy. Java would force my reader threads to use memory barriers during
their various searching activities'. Why bother...?

Therefore, I really hope that C++ will allow me to be in complete and total
control wrt the memory barriers that any of my code uses.

Thank you all for your time.

--
Chris Thomasson
http://appcore.home.comcast.net/
(portable lock-free data-structures)


Any constructive thoughts?
Sep 3 '06 #1
0 2062

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1472
by: Silver | last post by:
First of all...merry christmas everyone! Now, I have to write a program. Among other things, I need to overload the '*' operator, so that it returns a pointer-to-ponter of type int, which is...
11
1400
by: JKop | last post by:
Take the following: enum Sense { Vision, Hearing, Touch, Smell };
12
2901
by: Eva | last post by:
Hi, I try to implement quick sort. I sort vectors by their first value. 10 2 3 4 9 3 5 6 10 4 5 6 must be 9 3 5 6 10 2 3 4 10 4 5 6 The prog works great on maybe 500 vectors, but I have an...
5
1941
by: countzero | last post by:
Why not have the "new" operator return a typed handle when you get memory on the heap (if you want it to)? And then use a "lock" operator to get a pointer to the memory, and the pointer is only...
7
1614
by: Gumby | last post by:
I want to make a two-d array of unsigned ints that I can change the size of as I need more memory. To do this I put in the h file a simple pointer to the memory and row/col variables to retain the...
193
9374
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
21
1765
by: Jim | last post by:
I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005. But, I don't really even know how the internal workings of a proxy should act. Does anyone have anything on the protocols used in...
6
2041
by: an0011 | last post by:
Hi static double *var = (double*) malloc(100000*sizeof(double)); is used among other memory allocations to store data that comes from a ..mat file The declarations are done on the main .cpp...
3
4359
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
4
1270
by: NvrBst | last post by:
A few quick questions if possible. 1 - If I have a "List<..myList" and set it as a datasouce for say ListBox1, then change items in "myList" is the correct/only way to update the ListBox with...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5052
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.