LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02: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, 09:40 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
"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, 07:03 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 03:30 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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, 07:53 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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 04:49 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Security 1 09-15-2009 12:56 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 08:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 10:45 AM
Out of address space - Now what do I do? Travis86 Programming 4 02-24-2007 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 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
Open Source Consulting | Domain Registration