LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2004, 12:36 AM   #1
linorg
Member
 
Registered: Nov 2003
Location: delhi
Distribution: redhat 8.0 ,fedora
Posts: 32

Rep: Reputation: 15
accessing process address space


hi all
i am currenlty studying distributed os and i find the concept of process migration quiet interesting
could anybody plz tell how can we access a processes address space so that it can be transferred to anohter terminal on the network
thanks
linorg
LQ freak
 
Old 04-14-2004, 10:52 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Uf! Not easy stuff...
 
Old 04-14-2004, 11:06 AM   #3
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
i am just shooting in the dark...dunno if i am correct or not..
but i guess if you are talking of the same process being copied with the whole of task struct loooking the same on both the terminals...i guess...for starters ...hand fork a process with the task struct duplicated to the tee..
and then do whatever is done while process creation....like putting that pid in a doubly linked list containing the processes,,,
putting it in the correct queue vis a vis its state in the task struct..
...and also , i think it would not be a bad idea to spawn this process in sleeping state so that kernel schedules normally without having to worry about the new process that has been created


i just hope that what i just blurted out makes some sense
 
Old 04-14-2004, 01:08 PM   #4
linorg
Member
 
Registered: Nov 2003
Location: delhi
Distribution: redhat 8.0 ,fedora
Posts: 32

Original Poster
Rep: Reputation: 15
hey shishir could u plz elaborate a bit more on that
linorg
 
Old 04-15-2004, 01:32 AM   #5
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
what i mean to say is ...sort of replicate the fork code ..just that you will be having a lot of information alread handy with you...so instead of having to initialise the tak_struct iwth some values that the kernel does...you can initialise the task_struct with the values that you have with you...
and then just put the new process in the run queue...with the state as TASK_RUNNING, or put it in a wait state and then let the kernel schedule it...
earlier i said that sleeping is a better idea..i think putting it on the run queue would also not be that bad a thing...

so basically what i am saying is that you can wirte a new fork with limited functionality with the input being the task_struct that you have for the process already running at one place...

i hope i have helped...

//pseudo code
somethinng like this
my_fork(void *task_buf)
{
struct task_struct *my_task;
//look for a free pid
//take the first free..

//cast the input buffer into a task struct
my_task = (struct task_struct *)task_struct;

//update the my_task with the relevant new values like
new state, new pid.
//may be call schedule() after that...

}
 
Old 04-15-2004, 01:13 PM   #6
linorg
Member
 
Registered: Nov 2003
Location: delhi
Distribution: redhat 8.0 ,fedora
Posts: 32

Original Poster
Rep: Reputation: 15
hi
shishir thanx for the info
i guess this should provide me a break through
bye for now
linorg
 
  


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
accessing task_struct of process shukla_chanchal Linux - General 1 11-04-2005 09:27 PM
maximun address space for a process sarunya Linux - General 1 08-30-2005 10:56 AM
Per-process address space in x86_64? geezjan Red Hat 1 04-07-2005 04:57 AM
Per-process address space in RHEL x86_64? geezjan Linux - Software 0 04-06-2005 01:19 PM
accessing folder with 'space' in the name kushalkoolwal Linux - Newbie 2 03-11-2004 02:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 PM.

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