473,946 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

[...]

<wk****@yahoo.c omwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
>
kanze wrote:
>wk****@yahoo.co m 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 2089

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

Similar topics

7
1498
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 intended to contain a 2d array. Now, I have 2 classes, as follows: class A {
11
1436
by: JKop | last post by:
Take the following: enum Sense { Vision, Hearing, Touch, Smell };
12
2949
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 "Aborted(core
5
1963
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 valid within the scope of the function. Then on idle time, all memory is unlocked and can be compacted. I wonder if there is a way of doing this by overiding the global new and delete operators and somehow checking for handle types? In any case...
7
1639
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 current size. private: unsigned int* mergeKeyTable; unsigned int rows; unsigned int cols;
193
9823
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 speak only of features in the spirit of C; something like object-orientation, though a nice feature, does not belong in C. Something like being able to #define a #define would be very handy, though, e.g: #define DECLARE_FOO(bar) #define...
21
1812
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 handling requests by proxies? I have Googled my eyes out....and found nothing. (BTW, props to Google for refusing the ridiculous request for their search results.)
6
2066
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 file and then used by other ..cpp files one of those files is similar to the following:
3
4397
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 the file) with the location. And for a particular section I parse only that section. The file is something like, .... DATAS
4
1288
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 the following? ListBox1.DataSource = null; ListBox1.DataSource = myList; 2 - BindingList<...is the same as List<...except when it is set as
0
9977
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10684
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6325
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3533
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.