• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Address space and thread space in threads

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does OS handles Address space and Data space in context of threads ?
Pls help me by answering this query.
Tx in advance
Anu
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which OS.
Nope - don't even bother. If you have to know the OS then you shouldn't be messing with it using Java.
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agreed with Cindy, but probably it's question from some test, so I try to answer somehow.
Threads... (Do you means java thread ?)
You should think as you write
implementation of JVM...
What data use thread:
1. commands
There should be address space of commands (java byte code or compiled code).
It should be shared for all threads. (Differents threads can call the same function, so use the
same byte (or compiled) code from some address segment).
2. common data for all threads,
You can create object in one thread and use it
in other. So java objects (hava heap) should be in the same address space for all threads.
3. authomatic variables, local function variables,
return address of functions.
(Do you wish to use different stacks - one for
return addresses and one for local variables ?
Probably one is enough)

Each function can use it's own local (automatic)
variables. Them are local for each theads.
So each thread should have its own stack.
If I don't forget something, we can sketch now
memory model for jvm: common address space for
heap, common address space for commands, and
a lot of stacks. One per thread.
You can dynamically load/unload classes, make/drop
compiled version of code, so space for commands is
heap, probably you can use the same heap for commands and for data (java objects)....
E.t.c ....
Now you should think how your OS support memory
mapping, how can you change size of mapped memory
segments, what table should describe the all threads, etc ...
[ November 11, 2002: Message edited by: Igor Ko ]
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic