• Post Reply Bookmark Topic Watch Topic
  • New Topic

address space?  RSS feed

 
Ravissant Markenday
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone!
could anyone please tell me what is meant by an address space in terms of threads( from the definition that threads share the same address space).

Thanks in advance,
Ravissant Markenday
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two threads share the same same addressable memory i.e. two threads can access the same memory location (they run in the same process\JVM). If the threads run in seperate address spaces i.e. different processes -> seperate JVM's then changes in memory are not visible to the other thread. Basically all it means if you change the same variable in two threads they can see the results of the other threads actions (ignoring memory barrier issues etc etc), if they ran in sperate address spaces (JVM/processes) this can't happen as the JVM prevents it (if it didn't a good OS would)

In old school terms an application on a theoretical OS might be assigned one range of physical memory address and another application (process\JVM) another range to run so they both have their own address space and shouldn't write to the other i.e. one thread might have access to memory locations 1000-2000 and annother in a seperate process 2000-4000 (obviously what I have described there is a GROSS simplification and not a real world example i.e. completely ignored address mapping \ virtual memory etc etc etc . Its a bit easier to understand if you do C++ with pointers etc.
 
Ravissant Markenday
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the detailed reply Chris!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!