f



C Multithreading variable memorization

Hi all,
can someone explain me how variables are stored in a multithreading program?Is there an outline?Does it depends on compiler or SO?How is the memory divided?Thank you for your replay.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
andreaesposito77
4/16/2013 1:00:24 AM
comp.lang.c.moderated 1019 articles. 0 followers. Post Follow

6 Replies
236 Views

Similar Articles

[PageSpeed] 26

On 16/04/2013 02:00, andreaesposito77@gmail.com wrote:
> Hi all,
> can someone explain me how variables are stored in a multithreading program?
Is there an outline?Does it depends on compiler or SO?How is the memory 
divided?
Thank you for your replay.
>


C (in common with most other programming languages) does bot specify how 
things are done only what the results shall be. An implementation is 
free to provide storage for variables in any way that it sees fit. A 
stack per thread is not uncommon but there are other ways (linked frames 
will do as well and has been used on some systems)

The question is 'Why does it matter to you as a programmer?'

Implementers have to worry about these (often hardware dependant) 
details the rest of us only have to worry if they get it wrong.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Francis
4/25/2013 10:23:19 PM
On Mon, 15 Apr 2013 20:00:24 -0500 (CDT), andreaesposito77@gmail.com
wrote:

>Hi all,
>can someone explain me how variables are stored in a multithreading program?Is there an outline?Does it depends on compiler or SO?How is the memory divided?Thank you for your replay.

It is completely implementation specific.

-- 
Remove del for email
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Barry
4/25/2013 10:23:22 PM
Am 16.04.2013 03:00, schrieb andreaesposito77@gmail.com:
> Hi all,
> can someone explain me how variables are stored in a multithreading program?Is there an outline?Does it depends on compiler or SO?How is the memory divided?Thank you for your replay.
>
There is no difference to single threaded applications. It is on you to 
serialise access when you need to share with other threads.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Herbert
4/25/2013 10:23:28 PM
On 2013-04-16, andreaesposito77@gmail.com <andreaesposito77@gmail.com> wrote:
> Hi all,
> can someone explain me how variables are stored in a multithreading
> program? 

AFAIK mutlithreading is not part of the C standard.  If you asked this
in comp.lang.c you could probbly get shouted at.

> Is there an outline?  

trpically "auto" variables are private to your thread and globals and
static variables are shared betwen threads.  library functions that
were implemented using static variables are not "thread safe" and hee
are often thread safe variants privided 

> Does it depends on compiler or SO?

some vendors provide a mechanism for some static variables to be made
private to the thread. check your compiler documentation 

> How is the memory divided?

not sure what you mean.

-- 
⚂⚃ 100% natural

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Jasen
5/2/2013 12:19:58 AM
Jasen Betts <jasen@xnet.co.nz> writes:
> AFAIK mutlithreading is not part of the C standard.

It is in C11.

DES
-- 
Dag-Erling Smørgrav - des@des.no
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
utf
5/8/2013 5:37:33 PM
On Wed, 1 May 2013 19:19:58 -0500 (CDT), Jasen Betts
<jasen@xnet.co.nz> wrote:

>On 2013-04-16, andreaesposito77@gmail.com <andreaesposito77@gmail.com> wrote:
>> Hi all,
>> can someone explain me how variables are stored in a multithreading
>> program? 
>
>AFAIK mutlithreading is not part of the C standard.  If you asked this
>in comp.lang.c you could probbly get shouted at.


C11 added threading.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Robert
5/8/2013 5:37:36 PM
Reply:

Similar Artilces:

jython and C-c C-c
How do I get C-c C-c to work with jython? I have the jpython command set to jython, and I can start the interpreter with C-C ! and then use C-c C-c, but this is rather frustrating. If I try to use C-c C-c without first starting the interpreter in another window I get wrong type argument: sequencep, jpython Thanks, Dave Cook ...

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta >...

C/C++ in MATALB or MATLAB in C/C++?
Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

c------->c++ and c++------>c
We can write c program in turbo c++ editor.But reverse is not true why? i.e The program will not compile if u write c++ program in turbo c editor vim wrote: > We can write c program in turbo c++ editor.But reverse is not true why? > i.e The program will not compile if u write c++ program in turbo c > editor This isn't about C; this is about some editor. Why the fircone should /we/ know? Ask in a relevant group. [And /why/, in an editor specialised to some specific programming languages, would you expect it to compile a /different/ one? Would you expect turbo perl to compi...

C/C++ in matlab and matlab in C/C++ ?
Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

slime C-c C-c annoyance
Does anyone have a good workaround for this problem other than: just be careful! When I've compiled a large package and slime has given me a *slime-compilation* buffer, I like to work through this buffer issue by issue, fixing the errors, warnings, etc. But If I ever press C-c C-c in the editor window while fixing an error, slime destroys the *(slime-compilation* buffer with the compilation output of C-c C-c. Jim Newton <jimka.issy@gmail.com> writes: > Does anyone have a good workaround for this problem other than: just be careful! > > When I've compiled a ...

C as a Subset of C++ (or C++ as a superset of C)
Isn't it a lame use of human time and effort to maintain completely separate C and C++ standards? As in the words of Betty White about Facebook: "It seems like an incredible waste of time". Why don't the two standards groups get together and agree on a common specification for the ground which both standards cover? There would still be two separate standards, but they'd both be exactly the same for the common ground. The common ground document could be referred to by both standards instead of being maintained by both groups in individual efforts resulting in...

C, C++ and C# Forums
Throne Software has opened up C, C++ and C# Forums at: http://www.thronesoftware.com/forum/ Join us! Throne Software wrote: > Throne Software has opened up C, C++ and C# Forums at: > > http://www.thronesoftware.com/forum/ For all of your forums newsgroups already exist. > Join us! Why? Don't see any reason to support your marketing. ...

C,, C++, Java, C#
I come from C,C++,Java and C#. What can SmallTalk do for me and for what cost? Regarding the Squeak thing, it's interesting though confusing. Is it an IDE? Why are the menus so wacky? "DM McGowan II" <nospam@nospam.net> wrote in message news:PLednX2vnLd11IncRVn-rA@comcast.com... > I come from C,C++,Java and C#. What can SmallTalk do for me ...? Ask not what Smalltalk can do for, but what can you do with Smalltalk. :-) In very few words, it significantly reduces time to market, while enhancig the development experience. This is because: 1. It...

C, C++ and C# Forums
Throne Software has opened up C, C++ and C# Forums at: http://www.thronesoftware.com/forum/ Join us! ...

C, C++ and C# Forums
Throne Software has opened up C, C++ and C# Forums at: http://www.thronesoftware.com/forum/ Join us! In article <1120963701.862698.160260@g14g2000cwa.googlegroups.com>, Throne Software <mail@thronesoftware.com> writes >Throne Software has opened up C, C++ and C# Forums at: > >http://www.thronesoftware.com/forum/ > >Join us! Why? The beauty of news groups is that they come to me I don't have to go to them. Also all the people who have been around a while know what they are doing and are here. I noticed that there are some C and C++ Forums on another system...

c,c++,obj-c
Of the 3 languages titled in this post is c++ older than obj-c ? Would someone experienced in C be able to dive right into C++ rather than obj-c ? Java is out for me now except applet programming I think I'm going to go with just C and C++. Bill Bill Cunningham wrote: > Of the 3 languages titled in this post is c++ older than obj-c ? Why does that matter? Do you want to use an old language? Try Fortran or LISP. > Would > someone experienced in C be able to dive right into C++ rather than > obj-c ? Not quite dive in, at least not into the OO parts of C++. ...

About C and C++
Hello, I will resume it like this: On the criterias of "complexity" and "difficulty", the C and C++ programming languages are more complex and difficult than Object Pascal for example, so since they are more complex and difficult they are likely to create something like a darwinian filter who don't let the weaker humans among us humans to cross or to climb the social ladder, this is why i think that C and C++ do participate to social darwinism, this is why i say that C and C++ are bad. Thank you, Amine Moulay Ramdane. On Sun, 08 Jun 2014 06:1...

Is this C or C++?
Simple question. If the task is (for example): "Write a C++ program which asks user his name (less than 20 chars) and prints it." Then, is this code a correct answer: char name[100]; cout<<"Your name?"<<endl; cin>>name; cout<<name<<endl; The point being, that the code uses C string "char name[]" and not C++ std::string. C is a subset of C++, so isnt it logically speaking a C++ program? On Tue, 19 Nov 2013 21:44:40 -0000, "crea" <no@com.notvalid> wrote: >Simple question. If the task is (...

Web resources about - C Multithreading variable memorization - comp.lang.c.moderated

Multithreading (computer architecture) - Wikipedia, the free encyclopedia
Multithreading computers have hardware support to efficiently execute multiple threads . These are distinguished from multiprocessing systems ...

Introduction to Multithreading, Superthreading and Hyperthreading
We took some time to look into simultaneous multithreading (SMT), as hyper- …

AMD’s next-gen CPU leak: 14nm, simultaneous multithreading, and DDR4 support
New rumors are starting to surface regarding AMD's upcoming Zen architecture. Will 14nm technology, DDR4 support, and a new multi-threading model ...

JXCore brings multithreading, sort of, to Node.js
Node.js's open source nature and highly liberal MIT licensing same as the V8 JavaScript engine at the heart of Node.js invites all manner of ...

If you have multithreading in Windows Phone 7 do you need multitasking?
Exploring how WP7 handles multiple application threads

Determinism Is Not Enough: Making Parallel Programs Reliable with Stable Multithreading - Lambda the ...
Junfeng Yang, Heming Cui, Jingyue Wu, Yang Tang, and Gang Hu, "Determinism Is Not Enough: Making Parallel Programs Reliable with Stable Multithreading" ...

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 325 ...

Central processing unit - Wikipedia, the free encyclopedia
The central processing unit ( CPU ) is the portion of a computer system that carries out the instructions of a computer program , to perform ...

AK's weblog - Entries tagged as benchmark
Well, be warned that this comparison is highly unscientific and makes no claims about the overall performance of the mentioned webservers. Anyway, ...

MPlayer OSX Extended
is the future of MPlayer OSX. Leveraging the power of the MPlayer and FFmpeg open source projects, aims to deliver a powerful, functional and ...

Resources last updated: 2/8/2016 10:07:34 PM