LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2011, 03:58 AM   #1
vishnu anand
LQ Newbie
 
Registered: Dec 2011
Posts: 12

Rep: Reputation: Disabled
Question address space


what is meant by address space??? if we create a thread for process,does the thread and process share address space??? do we need IPC between process on the same address space???
 
Old 12-16-2011, 10:40 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,578
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
"address space" generally is talking about the memory map of a process.

On Linux you can run cat /proc/<PID>/maps to see the memory map for the given process ID. (Use ps -ef to see the PIDs running on your system). On Linux threads can show up as separate PIDs. To verify they are using the same memory map you can just diff the maps - if they are the same then you know they are threads.

IPC = Interprocess Communication - As noted by this name it is used to communicate between processes. You'd want to do more reading on IPC (shared memory, semaphores and message queues) for more detail about using these in programs.
 
1 members found this post helpful.
Old 12-18-2011, 08:03 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
IME, using kernel 2.4.x, threads show up as separate processes; using 2.6.x they don't show up at all, only the orig process is seen using eg ps or top cmds..
 
1 members found this post helpful.
Old 12-19-2011, 04:30 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,578
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Actually you can see the threads with various ps options for example with "ps -eLF" - the LWP stuff in the output relates the thread ID and the number of threads. If you do this you can still see /proc/<LWP>/... info just as you could in the past.

I agree however that the default display changed so it doesn't show threads by default as it did. Actually I had a couple of old 2.4.x systems a long time ago and was confused back then because on one of them I had to add a flag (-m as I recall) to see the threads in process list but the other was showing them by default.
 
1 members found this post helpful.
Old 12-19-2011, 08:53 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Yeah, I should have said that threads are not full processes (in the std defn of a proc) as of 2.6.x.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shared memory address area in process address space nagaraju1024 Programming 3 02-22-2011 05:49 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Security 1 09-15-2009 01:56 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 09:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 11:45 AM
Out of address space - Now what do I do? Travis86 Programming 4 02-24-2007 08:10 AM


All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration