Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-18-2010, 10:02 AM   #1
LQ Newbie
Registered: Mar 2009
Posts: 13

Rep: Reputation: 0
clone() system call, Share Heap.

Hi all,
In my program I have a requirement to
-->1)create a child which should have different PCB's so that I want to handle same signal differently in Main Thread and Child Thread.
-->2)I want to Share Global data(Heap) between Main Thread and Child.

To achieve this I tried to Use Clone() system call with CLONE_FS and CLONE_FILES and requirement 1) was achieved by pthread_sigmask and sigaction().
But I Could not fulfill requirement 2).

Is my approach correct? If not give please give me a suggestion.

Is this possible WITHOUT Inter Process Communication?
Is it possible with clone() system call?
Old 06-18-2010, 11:06 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

If you want to share memory between processes, use one of the shared memory APIs.

If you want to share *all* data in the entire program, use threads.

Perhaps your best bet might be:
a) use threads
b) find an alternative to using signals
Old 06-20-2010, 12:51 AM   #3
LQ Newbie
Registered: Mar 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Thank you for your 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
OSE system call functions to Linux Sytem Call functions required roshantraj30 Linux - General 0 06-08-2009 03:06 AM
How to call system call from usb driver's code Mr.J Linux - Kernel 4 09-29-2008 04:47 AM
How can i make centos 4.5's system call using vDSO(call *%gs:0x10) instead of int80 tclwp Red Hat 3 08-06-2007 01:07 AM
Calling a system call from a system call? Loc_8 Programming 0 09-16-2006 05:21 PM
clone system call swadesh Linux - Software 0 02-07-2005 01:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:17 AM.

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