Child and Parent Threads

I have a parent thread class PThread which
instantiates some child threads CThread in its run()
method..
Now Child threads need to give their status/information
back to Parent thread periodically.
Can I child thread callback any function of Parent
thread

Actually in my case, 1 parent Thread is running and it instantiates multiple child Threads (the number will be decided based on input from some file)....Now these Child Threads are doing some measurements...Each Child Thread is maintaining a bool variable
"isActive"...If the measurement is not bein taken, it sets the isActive flag to false, otherwise true...(Different Child threads have their own "isActive" Status)...
Now, there are Some other classes in System who are interested in knowing which Measurements are Active....(that means they want to know the status of Individual Child threads).....These classes are
interacting with Parent class only....
That's why I wanted individual Childs to update their current status
periodically to Parent , so that when Parent is asked this information
from Other classes, it can Consolidate and present the data....
This was the only purpose, why I asked whether we can call from
inside Child Thread, any functon of Parent Thread..
What I understood from your comments that if Child Thread has access to Parent Thread's Object....(wich should be passed to it during new),
it can callback Parent's functions.
That should solve the purpose.....
Regarding stopping of threads, Parent thread is itself gets information/interrupt from some other class to stop itself... when it
gets the information, it will stops the Child threads too...I was thinking of calling some stop()
function of individual child threads which will call their interrupt()..
And at the end I will call the interrupt() of Parent class....
I don't know much about usage of join(), so will have to study more
about how can I do it better.
Also one thing more:-
Both Child and Parent Thread classes are extending Thread.
They don't have to extend from any other class...I have to
write specific functionality in run() function of parent and class.
Should I change it to runnable....Why did you advised against
extending threads

Similar Messages

  • XML childs and parent in same DataGrid

    Hi, if I have a XML with this structure:
    <product>
         <description>Cel Motorola 12</description>
         <childS>
              <child>secret data</child>
         </childS>
    </product>
    In my data grid, I put:
    <mx:DataGrid id="dataGridFaixas" dataProvider="{_myXML}" left="0" right="0" top="0" bottom="0" fontSize="9" borderStyle="none">
        <mx:columns>
            <mx:DataGridColumn dataField="product.childS.child" headerText="Cd. Site" width="50"/>
        </mx:columns>
    </mx:DataGrid>
    This is ok, but the data exibth is: "<child>secret data</child>" and no "secret data"...
    help?

    I decided flattern de XML strutcture before set as dataProvider on datagrid, revolve... :|

  • IMessage combining child and parent text messages

    When my child sends a text message it appears that the message comes from me, the adult. When I try to text my child she doesn't receive the message and I text myself.
    I've tried to find ways to untether child/parent but I can't. 
    my iMessage settings show only my Apple ID, email, phone number
    child doesn't have a computer of her own
    I logged into her iCloud but didn't find settings that applied to imessage.
    Please help, I am flooded with tween-aged text messages!

    Thanks Radiation Mac,
    I have a Mac and she only texts from her phone. I think your instructions are for a Windows system maybe?
    Whichever Apple ID is currently logged into "iCloud" (located in Applications>System Preferences>iCloud) will be the Host who's iMessage account is sent from. 
    Anyway, you gave me a great tip.
    iPhone Settings
    Messages
    Send & Receive"You can be reached by iMessage at:" her cell phone number was in this space.
    My life is good once again.
    OMG! ttyl - you saved me from tween ****.

  • Formula flip the sign between child and parent account member

    I have created two accounts as below which is parent to the child (670122) and child (670122.01) account and my account dimension looks as below
    Account    PARENTH1     GROUP          ACCTYPE     RATETYPE
    670122        670120         Profit & Loss            EXP           AVG
    670122.01  670122         Profit & Loss            EXP          AVG     
    PRETAX        INCOME         Profit & Loss            INC          AVG     
    Now I have added the simple formula in the child account 670122.01 in the formulah1 column as [Account].[PRETAX] Which is Income account but when I retrieve the data  using EVDRE(), the Values are shown as below
    670122.01     670122
    3,398,006.86      (3,398,006.86)
    Why do the parent and child has different sign when both accounts are same account type as Expense. Instead of formula if I put hardcoded value, then both parent and child accounts has the same value (not flipping the sign)

    We are using BPC 5.0 and SQL Server 2005
    The hierarchy is like this
    670120 -> 670122 -> 670122.01
    The dimension formula is in 670122.01 as like this ( [Account].[PRETAX]-[Account].[665000] ), 665000 is a expense account and pretax is income account
    When I do the EVDRE on those above accounts
    670120     670122     670122.01
    (13,228,910.18)     (13,228,910.18)     13,228,910.18
    When 670122.01 is rolled up to next immediate level, the value in 670122 has negative value. 670122 is rolled up to 670120, but they both have same value - Is this a known issue in the BPC 5.0?

  • Hierarchy display child and parent nodes -- Urgent Please

    Sorry wrong forum
    Message was edited by:
            Shree Sunder

    I like ListAgg :D
    with RELATION(PARENT,CHILD) as(
    select NULL,'A' from dual union all
    select 'A', 'B' from dual union all
    select 'A', 'C' from dual union all
    select 'B', 'D' from dual union all
    select 'B', 'E' from dual union all
    select 'D', 'F' from dual union all
    select 'C', 'G' from dual union all
    select NULL,'H' from dual union all
    select 'H', 'I' from dual union all
    select 'H', 'J' from dual)
    SELECT ListAgg(child,'<-')
           within group(order by Level desc) as revPath
    FROM relation
    START WITH child = 'F'
    CONNECT BY PRIOR parent = child;
    revPath
    A<-B<-D<-F

  • 1510 Child and Parent don't talk

    I have a 1510 network set up like this:
    http://www.cisco.com/en/US/i/100001-200000/150001-160000/153001-154000/153656.jpg
    The Controller 4404 in the headquarter (Site 1). From the headquarter we use 1400 bridge to connect to a 1510(RAP or Site 2) via a switch. Then over the 5.8 backhaul, we connect to another 1510 (Map or Site 3), which is a child for Site 2.
    From the headquarter, we can talk to either Site 2 and/or Site 3. However, when information requested from Site 3 to Site 2, we are having problems. It seem to me like Site 3 and Site 2 don't talk to each other directly. Can someone help me please? Thank you

    In a wireless mesh deployment multiple AP1510s are deployed as part of the same network. One or more AP1510s have a wired connection to the controller and are designated as root access points (RAPs). Other AP1510s that relay their wireless connections to connect to the controller are called mesh access points (MAPs). The MAPs use the AWPP protocol to determine the best path through the other AP1510s to the controller. The possible paths between the MAPs and RAPs form the wireless mesh that is used to carry traffic from wireless LAN clients connected to MAPs and to carry traffic from devices connected to MAP Ethernet ports.
    For the controlling the AP following configuration guide may help you :
    http://www.cisco.com/en/US/docs/wireless/controller/4.2/configuration/guide/c42lwap.html#wp1112844

  • How To Display  attributes of Child Node and Parent Node in same view

    Suppose I have two view Carview and CarDetail View...IN Component context I have Parent Node Called Cars and It have its attribute as Price,Warranty,Year and also One Child Node Called as Brand Name Whose attribute are PrimaryBrand and SecondaryBrand..Now If I do Mapping of My First View i.e CarView with Child node of BrandName..and then I Have To Show Whole Detail of Car in CarDetailView.......How Can I Achieve it..

    Hi Vinay,
    You can map the child node and even the paren tnode to the same view if u want to display in the same window..
    If not if ur requirment is to dispaly in the sme view but should not map the child and parent to the Same view then you can take another new view.. and insert 2 view containers and then add the Child view and parent view in that view containers and then Diaplay the newly created view.
    Regards,
    Raju Bonagiri

  • Issue with child and parnet table

    how i can identified that which table is chiald and which one is parent table.

    If you are keeping referential integrity in the database, not in the application, it is easy to find the child and parent tables. Here is a quick and dirty query. You can join this to dba_cons_columns to find out on which columns the referential constraints are defined. This lists all child-parent table including SYS and SYSTEM users. You can run this for specific users of course.
    select cons1.owner child_owner,cons1.table_name child_table,
    cons2.owner parent_owner,cons2.table_name parent_table
    from dba_constraints cons1,dba_constraints cons2
    where cons1.constraint_type='R'
    and cons1.r_constraint_name=cons2.constraint_name;

  • Can a parent thread kill a child thread?

    I'm writing a multi-threaded application in which it is possible for one of the threads to go into an infinite loop. Is there any way for a parent thread to actually kill the child thread that has gone into the infinite loop? Of course the parent thread won't actually be able to discern whether or not the child thread is in an infinite loop. I would specify some time out value, and when it has been exceeded, then I would want to kill the child thread. Is this possible without setting any sort of flag that the child would read, because once it gets stuck inside an infinite loop, there will be no way to read the flag.

    Here's an example of a program that I wrote to simply ping a server. It works somewhat backwards from what you were looking for (the child interrupts the parent) but should provide some clue:
    import java.net.*;
    import java.io.*;
    import java.util.Date;
    public class ServerPing extends Thread {
      String [] args;
      public static void main(String[] args) throws Exception {
        ServerPing sp = new ServerPing(args);
        sp.start();
      ServerPing(String [] args) {
        this.args = args;
      public void run() {
        Pinger pinger = new Pinger(this);
        pinger.start();
        try {
          sleep(30000);
        catch (InterruptedException x) {
          System.exit(0); // this is ok. It means the pinger interrupted.
        System.out.println("TIMEOUT");
        System.exit(1);
    class Pinger extends Thread {
      Thread p = null;
      Pinger (Thread p) {
        this.p = p;
      public void run() {
        try {
          URL simpleURL = new URL("http://localhost:7001/ping.jsp");
          BufferedReader in = new BufferedReader(new InputStreamReader(simpleURL.openStream()));
          String inputLine;
          while ((inputLine = in.readLine()) != null)
          System.out.println(inputLine);
          in.close();
          p.interrupt();   // <<-- interrupt the parent
        catch (Exception x) {
          x.printStackTrace();
    }

  • Siebel BIP Integration Objec for Parent, Child and Grand Child

    Hi,
    I 'm trying to create a one report for displaying Parent, Child and Grand Child.
    Service Request
    - Quote
    - Quote Item.
    Successfully create the BIP Integration object and generated the xml file. problem here is when trying to include the fields in BIP desktop word, not able to see the grand child fields, could see only the parent and child fileds and for grand child only 'ListOfQuoteItem' text.
    Could some one please let me know the reason for this behavoir and wherther BIP supports 3 levels.
    Is there any Out of Box Siebel report showing parent, child and grandchild.
    Thanks,
    Ravi kanth

    One Siebel Adapter Upsert operation should be sufficient to insert the parent and child. In the Integration object definition, you define the Template child instances with the Parent of Template. i.e
    You define Template first as an Integration Component and then define
    Template child instances to have a Parent as Template.
    Thanks
    Swarna

  • HT201089 I am setting up an Ipad for my child and downloading apps with Ask to Buy turned on.  As the parent, I am not receiving notices/requests on my device

    I have an ipad mini 2 with ios 8 and and iphone 5s with ios8
    I am setting up the ipad for my child and the Ask to Buy feature is on in family sharing.
    I am trying to download apps from the app store and it pops up the notification that I need to Ask to Buy and the request is being sent.
    The request should be coming to my "parent" device, which happens to be my iphone correct ?   I'm not seeing any sort of requests.
    According to the posts I've read a request is only sent once.

    Apps downloaded on one should also appear on the other as long as the app in question runs on both iPads and iPhones.

  • Killing Parent thread can kill child thread

    hi frnds
    can u help me on thread
    i want to know if i am kill my parent thread.can it automatically kill chhild thread also.
    and i want to know is there any way in java to kill thread
    plz reply

    ajju29 wrote:
    and i want to know is there any way in java to kill threadNo, not safely and not reliably. Since there's no way to "kill" a thread without its cooperation, the previous question is not relevant as well.
    What you want to do is set some flag that your thread periodically checks and maybe send an signal and/or interrupt to tell the thread to check the flag earlier. The thread should then quit on its own.
    Everything else is unfixably broken.

  • External Context Mapping - Pass data from Child to Parent

    Hello,
    I have the following scenario:
    DCParent Component (contains)
    - DCChildComp1    (used DC)
    - DCChildComp2    (used DC)
    - DCChildComp3    (used DC)
    - DCChildComp4    (used DC)
    What user enters in DCChildComp1 then needs to be made available to DCParent and all other DCChildComp(n) siblings.
    I have looked the posts and blogs in SDN and all of them seem to deal with passing inputField data from Parent to Child. May be I am missing it.
    In my case, I need the data to be passed from DCChildComp1 to DCParent ie Child to Parent. Then from DCParent to other DCChildComps.
    How should I go about
    a. defining the context nodes and Component Interface context nodes in parent vs child vs siblings and
    b. how should I map them externally?
    Step by step instruction would be helpful.
    Thanks in advance,
    SK.

    Thanks for all the help. As I had already seen all the links and blogs you had linked here, I was still confused about how it all came together. Finally, I got it after reading Bertram Ganz's response in this thread [Context Mapping problem;.
    when you map a context in the parent comp to an interface context in the used child component you do not define an external context mapping relation. That's normal context mapping as the data context resides in the child component.
    I have it working now and I am able to push the changes in the child component's context to the parent.
    For those who are interested in how I did it (and those who know a better way to do it
    In the child component DC:
    Map Child's View Context to Child's Controller Context
    Map Child's Controller Context to Child's Interface Controller (make sure the inputEnabled is FALSE - as the child is the data producer and the parent is the data consumer, in my case)
    In the parent DC:
    Add child DC as a Used DC
    Add child Component as a Used Component in the Parent Component
    Add Child's Interface Controller as Required Controller in Parent Component
    Map Child's Interface Controller Context to Parent's Controller Context
    Map Parent's Controller Context to Parent's View Context
    No external mapping required per the thread above. Now, any change in the child component's view is visible in the parent component view.
    Thanks again very much for the help.
    - Siva

  • SCCM 2012 SP1 | Database Replication Failing on from Child to Parent

    I am having a very urgent issue. The symptom manifested itself as an inability to distribute content (this months software update package) to a secondary site server with DP role. 
    As we dived into it we see that the replication links are dead with "Link has failed". 
    Using the replication link analyzer it fixes it for about 1 hour but then fails again. On a closer look I noticed that replication is working from parent to child but not child to parent. Also check out the time stamps:
    Parent Last Send and Child Recv are both up to date, only Parent Last Recv and Child Last Send are failing. 
    What do I do? 
    None of the logs seem to tell me much other than the statesys.log on both secondaries are pumping the following line over and over again almost to fast for cmtrace to keep up with:
    total chucks loaded (0)
    Oh final thought, we did restore a full offline disk image of the primary server a month ago due to a hardware server failure. The snapshot of the disk luckily was taken only 30 mins before the hardware failure but I suppose there could be something related
    to that although the server seems to have been fine these last few weeks until now.  

    Nothing I can see right now, I started the link up again, ill try to check the log right at the time the link fails this time. Here is a snip of what the child rcmctrl.log looks like:
    DRS sync started. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:43:29 4312 (0x10D8)
    DRS change application started. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    Launching 2 sprocs on queue ConfigMgrDRSQueue and 0 sprocs on queue ConfigMgrDRSSiteQueue.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    The asynchronous command finished with return message: [spDRSActivation finished at 11/07/2013 14:43:02. End execute query finished at 11/07/2013 14:43:02.].
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    There are 2 Drs Activations sprocs running.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:02
    4316 (0x10DC)
    InvokeRcmMonitor thread wait one more minute for incoming event...
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:10 4324 (0x10E4)
    InvokeRcmConfigure thread wait one more minute for incoming event...
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Wait for inbox notification timed out. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Cleaning the RCM inbox if there are any *.RCM files for further change notifications....
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Initializing RCM. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Processing Replication Configure SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Running configuration EnsureServiceBrokerEnabled.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Running configuration EnsureServiceBrokerQueuesAreEnabled.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Processing Replication Monitor SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Summarizing all replication links for monitoring UI.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Processing replication pattern global_proxy.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    The current site status: ReplicationActive.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4324 (0x10E4)
    Processing Replication success. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Processing replication pattern procedureForwarder.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Running configuration ConfigureLinkedServers.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Found 1 servers that needs to be linked. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Processing Replication success. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4320 (0x10E0)
    Rcm control is waiting for file change notification or timeout after 60 seconds.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)
    Cleaning the RCM inbox if there are any *.RCM files for further change notifications....
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)
    Rcm control is waiting for file change notification or timeout after 60 seconds.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)

  • Safari, Secure connection to sites, and Parental Control

    I'm setting up Safari for a child, and have Parental Controls enabled and am customizing the list of sites that can be visited. I'm allowing Netflix.com and have multiple http and https Netflix URL's allowed. However, when I test accessing this site, Safari gives an error stating that it cannot establish a "secure connection".
    The same computer, with a different account, can access the same URL without the error. My assumption would be that since I specifically allowed several Netflix.com URL's, that this would work just fine. By granting specific access, you are bypassing Parental Controls in a controlled way.
    What's causing this to not work?
    Thanks for your help.

    Netflix only provides HTTPS when loggin in or visting the main site, not for the content or it would have to encrpyt the video stream (expensive).
    It also sends one to another site (with another name "movies.netflix.com" here) to view the content, perhaps you have to access the account from another machine, grab the URL it directs you too and enter that into Parental Controls.
    Silverlight also has to be updated, check your Flash too.
    https://www.mozilla.org/en-US/plugincheck/
    I did see the thread about using the IP address for HTTPS sites, but wouldn't there be a large number of IP addresses associated with a Netflix type of site due to all of the streaming video feeds available?
    If that wouldn't be a problem, does anyone know how to determine the IP address of Netflix?
    The video streams are not encrypted, and IP addresses are just the physical buildings of the servers themselves, the buisness name (URL) can change locations and that's what the Domain Name Server is used for to resolve those IP numbers for you in case they do change.
    Netflix log in and content delivery have different IP addresses, the content delivery may use IP's of servers closer to your location, so it would not assist you for me to give those out.
    You can install Firefox web browser and a add-on called FlagFox, which displays a little country flag in the URL address bar of each website you visit which you can right click and "Copy IP" if you so need it.
    I don't advise using the IP, as that can change, use the URL so the Domain Name Server of your ISP can provide the correct IP address so your comptuer can connect.
    Also Firefox has more add-ons for control and a nearly completely customizable web browser that may be a better choice for children/special needs (big buttons, type etc) than Safari.
    There is Public Fox which can lock down certain aspects of the browser (prevent downloads for instance or changing things.)
    Theme Font & Size Changer which can enlarge the type of Firefox itself, there is NoSquint which can auto-zoom all web pages etc.
    There are Firefox Personas and Themes that can dress up or "childize" the browser so it's more fun for children.

Maybe you are looking for

  • Batch Number with Box number

    Hello SAP Experts, My Client has a unique requirement, they want system to track Batch number with Box number. For Example if Batch number for incomming material is 123456, and if the entire quantity comes in 3 boxes, then the system should track the

  • Peak Audio Files

    Having real problems with peak audio generation.  Lots of projects that I open or re-open that where created in any version of Premiere CC (including 2014) have the wave form missing.  I have tried clearing the media cache to force Premiere to re-gen

  • How can I increase the number of episodes available in my feed?

    I have thirty-seven episodes in my podcast total (and growing)  but because I had the default setting at 20 in my WordPress blog's feed settings, iTunes only pulled twenty episodes. (as they should have) I have just increased the number of episodes a

  • Missing Effects

    I'm a self-taught (not learnt much yet) newbie... I've drawn a logo in Illustrator comprising a couple of basic shapes made of joined paths with stroke and fill the smae colour, i then took this object into photoshop and applied layer styles of Inner

  • Photoshop refuses to load images.

    So upon getting a new hard drive for my Powerbook (the old one on which Photoshop ran well enough) I have reinstalled the Adobe Creative Suite 2. Everything seems to work, except for Photoshop which, despite any attempt, refuses to load any image fil