Implementation of Posix Thread class in c++ for solaris system

Hello Everyone,
Please help me with information regarding how to implement Posix Thread Class in c++ for Solaris 5.8 system.
if available Please let me know any Open Source Posix Threads C++ built-in library available for Solaris System.
Thanks in Advance.
Thanks & Regards,
Vasu

Posix threads are available on Solaris, and can be used directly in C or C++ programs. Include the header <pthread.h> to get access to the types, constants, and functions. Compile with the option
-mt
on every command line, and link with the options
-mt -lpthread
If you want to create a class to provide a different sort of interface to phreads you can do so by building on the <pthread.h> functionality.

Similar Messages

  • Performance wise which is best extends Thread Class or implement Runnable

    Hi,
    Which one is best performance wise extends Thread Class or implement Runnable interface ?
    Which are the major difference between them and which one is best in which case.

    Which one is best performance wise extends Thread Class or implement Runnable interface ?Which kind of performance? Do you worry about thread creation time, or about execution time?
    If the latter, then don't : there is no effect on the code being executed.
    If the former (thread creation), then browse the API Javadoc about Executor and ExecutorService , and the other execution-related classes in the same package, to know about the usage of the various threading/execution models.
    If you worry about, more generally, throughput (which would be a better concern), then it is not impacted by whether you have implemented your code in a Runnable implementation class, or a Thread subclass.
    Which are the major difference between them and which one is best in which case.Runnable is almost always better design-wise :
    - it will eventually be executed in a thread, but it leaves you the flexibility to choose which thread (the current one, another thread, another from a pool,...). In particular you should read about Executor and ExecutorService as mentioned above. In particular, if you happen to actually have a performance problem, you can change the thread creation code with little impact on the code being executed in the threads.
    - it is an interface, and leaves you free to extend another class. Especially useful for the Command pattern.
    Edited by: jduprez on May 16, 2011 2:08 PM

  • Implementing Runnable interface  Vs  extending Thread class

    hi,
    i've come to know by some people says that Implementing Runnbale interface while creating a thread is better option rather than extending a Thread class. HOw and Why? Can anybody explain.?

    Its the same amount of programming work...
    Sometimes it is not possible to extend Thread, becuase your threaded class might have to extend something else.
    The only difference between implementing Runnable and extending Thread is that by extending Thread, each of your threads has a unique object associated with it, whereas with Runnable, many threads share the same object instance.
    http://developerlife.com/lessons/threadsintro/default.htm#Implementing

  • Runnable Vs Thread Class

    Hello All,
    I have a doubt regarding Runnable and Thread class. As we all know Java provides two ways to run Threads. One way is to extend Thread class and the other way is to implement Runnable Interface.
    Apart from the OOPS funda, does java have any other concept in providing two ways to run threads ?. I mean, we very well know that if we extend Thread class, we may not be able to extend any other class in Java . So if we implement Runnable interface,we can extend or implement any other Interface or class. Apart from this reason, does Java has any other concept in providing two ways to run threads ??
    Please share your knowledge
    Thanks and Have a Nice Day,
    Regds,
    Sai

    As far as I know, that's the only reason for the two options--one gives you flexibility in your class hierarchy, the other saves you a few lines of code. Personally, I always implement Runnable. The few lines of code saved seem trivial to me compared to "cleaner" OO (IMHO), but maybe somebody else has a better reason to extend Thread.

  • How does the servlet implement the multi-thread feature?

    There is only one instance of every servlet in one wep application.
    When several clients invoke the doPost() method of the same servlet,the servlet can process their request respectively.
    So there much multi threads of one servelt.
    But the Servlet doesn't implement the Runnable interface of extends the Thread class.
    I wan't to know,how does the servlet/servlet container implement the multi-thread feature?

    Hi johnnylzb
    There is only one servlet instance existing.
    (assuming u have <load-on-startup>1</load-on-startup>)
    The server creates a thread for every request ..
    and all the threads access the same servlet instance.
    For this its not necessary for the Servlet to extend Thread or Runnable.
    hope this helps

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write??
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

    Use the "code" formatting tags when posting code.
    Read this article on [url http://www.physci.org/codes/sscce.jsp]Creating a Simple Demo Program before posting any more code.
    Here is an example that updates a table from another thread:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=435487

  • How to access static variable from a Thread class

    Kindly help me.......
    here's the code.....
    class Thread1 extends Thread
    int j=0;
    myClass2 mc = new myClass2();
         public void run()
              for( int a=0;a<6;a++)
                        {try
                             { Thread.sleep(5000);
                             catch(Exception e){System.out.println("Interrupted Exception");}
                             j++;
    mc.change1(i);
    } System.out.println("Thread1 executes "+j+" times");
    class Thread2 extends Thread
    int k=0;
         myClass2 mc1 = new myClass2();
         public void run()
              for( int a=0;a<6;a++)
                        {try
                             { Thread.sleep(5000);
                             catch(Exception e){System.out.println("Interrupted Exception");}
                             k++;
    mc1.change2(i);
    }System.out.println("Thread2 executes "+k+" times");
    class myClass2
    static int i=5;
    public synchronized void change1(int s)
    s=6;
    System.out.println("New value of i:"+s);
    public synchronized void change2(int s)
    s=7;
    System.out.println("New value of i:"+s);
         public static void main(String args[])
    Thread1 b1 = new Thread1();
    Thread2 b2 = new Thread2();
         b1.start();
    b2.start();
    I am unable to pass the variable i in my method call in Thread1: mc.change1(i); and similarly in Thread2:mc.change2(i);

    You can declare your i variable in myClass2 as public static and then simply call there
        mc.change1( myClass2.i ) ;

  • CRM 7.0 implement method from MVC class

    Hello, folks.  I will prefix my question with the fact that I am a relative dinosaur in the development arena, still focused primarily procedural coding practices.  Although this still serves me well, it also means that I know little about OO development.  I have had some training and can make use of such common tools as OO ALV.  However, I know next to nothing about MVC (model view controller) programming, WEB Dynpro for ABAP, etc.  I am currently assigned to a CRM project (I am also new to CRM) and have a particular requirement that I cannot seem to address with any sort of procedural-based solution (i.e. function module).
    My requirement is to create a "URL Attachment" to a service request in CRM.  To elaborate, I have created an inbound point-to-point interface (i.e. not PI/XI) from an external system using Web Services.  The Web Service I have created ultimately invokes a call to function CRMXIF_ORDER_SAVE via a wrapper function I developed with the same interface.  This function, however, does not support the creation of "URL Attachments", only "Attachment Links".  So, my approach then is to implement additional functionality in my wrapper function to create this URL Attachment via some other means.  If you have any questions regarding URL Attachments vs. Attachment Links, please let me know.
    I have scoured the function modules to no avail.  What I have found is that via MVC, the functionality on the CRM Web UI is associated with the following class: CL_GS_CM_ADDURL_IMPL.  A search in SE24 reveals that there are actually several related? classes:
    CL_GS_CM_ADDURL
    CL_GS_CM_ADDURL_CN02
    CL_GS_CM_ADDURL_CN03
    CL_GS_CM_ADDURL_CTXT
    CL_GS_CM_ADDURL_IMPL
    My question is whether I can somehow implement one of these classes to address my requirement.  Looking at the logic within the IP_TO_ADDURL method, I cannot figure out whether I can somehow leverage this and, if so, exactly what coding would be required in my wrapper function.  I should also point that, at least from a Web UI point of view, this is a two step process whereby you must first create the attachment and the actually save it. 
    Any and all insights are much appreciated.
    Thanks.

    Hi there,
    I am not familiar with the CRM classes you mention - but what you describe is pretty much standard functionality included in Generic Object Services. May that path will lead you home.
    Cheers
    Graham Robbo

  • How can I use select() function in POSIX thread program.

    Hello
    Now I making a my own progam with POSIX thread in Solaris 8 Environment.
    But I have some trouble in POSIX thread.
    I saw that If use POSIX thread then use -D_POSIX_C_SOURCE=???L flag into compile options in
    Multithreaded Programming Guide.
    So I use that in my Makefile. But I can't compile my program.
    Now I found that if use POSIXC_SOURCE flag, cannot use timeval structure (defined in <sys/time.h>) in <sys/resource.h>.
    So compiling was stop into select() function. Because select() function use timeval structure.
    And fd_set structure(defined in <sys/select.h>) is same.
    How I solve this problem.
    Please help me.
    Thank you.

    Thanks so much for your helpful reply.
    Now I' ve already installed Adobe Creative Suite 6 Production Premium (Student Package), Extended included. But when I open Photoshop CS6, there' s still no 3D function in menu bar.
    Would you please tell me how to activate this function?
    Thanks,

  • Implementing sockets and threads in a jframe gui program

    Hi, I am trying to find a solution to a problem I am having designing my instant messenger application.
    I am creating listening sockets and threads for each client logged into the system. i want to know if there is a way to listen to other clients request from the main gui and then if another client tries to establish a connection with me for example, a thread is created for that client and then my chat gui opens automatically has soon has the other client sends his or hers first text message to me.
    I am relatively new at socket programming has I am currently studying along this area. I know how to create threads and sockets but I am having trouble finding out a solution to my problem. Here is the code that I have done so far for the listening method from my main gui, and the thread class of what I have done so far.
    listening socket:
         private void listeningSocket()
                ServerSocket serverSocket = null;
                boolean listening = true;
                try
                    //listen in port 4444;
                    serverSocket = new ServerSocket(4444);
                catch(IOException x)
                    JOptionPane.showMessageDialog(null, "cannot listen to port 4444", null, JOptionPane.ERROR_MESSAGE);
                while(listening)
                    client_thread w;
                    try
                       w = new client_thread(serverSocket.accept(), jTextArea1);
                       Thread t = new Thread(w);
                       t.start();
                    catch(IOException x)
                         JOptionPane.showMessageDialog(null, "error, cannot start new thread", null, JOptionPane.ERROR_MESSAGE);
            }thread class:
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    * @author jonathan
    public class client_thread extends Thread
         //define new socket object
        private Socket client_user = null;
        private JTextArea textArea;
        public client_thread(Socket client_user, JTextArea textArea)
            this.client_user = client_user;
            this.textArea = textArea;
        public void run()
            BufferedReader in = null;
            PrintWriter out = null;
            String error = "error has occured, messege was not sent";
            String messege = null;
             try
                //create input and output streams
                in = new BufferedReader(new InputStreamReader (client_user.getInputStream()));
                out = new PrintWriter(client_user.getOutputStream(), true);
                while(true)
                   //read messege sent by user
                   messege = in.readLine();
                    //display messege in textfield
                   out.println(messege);
                   textArea.append(messege);
            catch (IOException e)
                //error messege
                JOptionPane.showMessageDialog(null, error, null, JOptionPane.ERROR_MESSAGE);
    }

    Seems like all you need to do is create a new dialog for each socket that is established. Your current design looks like it will attempt to use the same textarea for all the sockets.
    I would say in your thread class do the following:
    MyConversationDialog dialog = new MyConversationDialog();
    while(true)
                   //read messege sent by user
                   messege = in.readLine();
                    //display messege in textfield
                   out.println(messege);
                   dialog.setVisible (true);
                   dialog.addMessage (message);
                }

  • Help! how to refresh the JTable of a class from another thread class

    there is an application, in server side ,there are two classes, one is a class called face class that screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much

    thank you very much !
    i tried it ,but the TableModel i used like this ,and how to change the TableModel?
    here the files of mine ,pls give me some help,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write?? }
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

  • TilePuzzle Class - Not looking for solution just how to do each method

    The TilePuzzle class represents the basic functionality of the tile puzzle game. Even if there is no window or text interface available, you should be able to play the game using an instance of the TilePuzzle object in the interactions pane. All other classes are used for display purposes; to show the contents of the TilePuzzle.
    This class is reponsible for performing the following operations:
       1. At creation, it initializes the instance variables used to store the current state of the game.
       2. When a move is specified, it checks if it is a legal move and makes the move if it is legal.
       3. It reports information about the current state of the game when asked (whether the player has won the game, how many moves have been made, what the current tile layout is, etc.)
    You are required to implement the following methods for this class:
    Method Name      Description
    TilePuzzle      
    The constructor for this class. This constructor takes in a two-dimensional array of integers, and uses this array to initialize its internal game grid. The grid represents the tile layout: the first dimension of the input array is assumed to be the horizontal dimension of the tile layout, and the second dimension of the array is the vertical dimension of the tile layout. The top-left grid position occurs at position (0,0). For example, in a 4x4 array called grid, the value in the top-right corner would be at grid[3][0], and the bottom left value would be at grid[0][3]. The one empty space in the layout of a tile puzzle is represented in the appropriate position in the grid with the value -1. You may assume that there will only ever be one empty space (-1) in the grid.
    The constructor should also set all the default values for the other instance variables used.
    moveTile      
    After the grid has been read and stored, the moveTile method takes in a single integer value that indicates a tile to move, and moves that tile into the blank tile's position, if it is a legal move. A move is only legal if the specified number exists in the grid, and if the specified tile's position is adjacent to the blank tile's position. The method returns a boolean value to indicate whether the move was made.
    hasWon      
    This method takes in no values, and returns a boolean value to indicate whether the current grid layout is a winning configuration or not. A winning configuration has the number 1 in the top-left corner, and increases incrementally from left to right along the row, continuing into the following rows (see illustation above). The empty space should be in the bottom-right corner of the grid.
    numTileMoves      This method takes in no values, and returns an integer that represents the number of tile moves performed so far. Actions that have not resulted in a tile being moved are not counted.
    maxTileValue      
    This method takes in no values, and returns the highest value that a tile in this puzzle can have, assuming that the first tile has a value of 1 and the other tile values increase incrementally (by 1).
    getGrid      
    This method returns a two-dimensional array of integers that represents the current grid of tile values. The first dimension of the array represents the horizontal dimension of the grid, and the second dimension of the array represents the vertical dimension of the grid. The orientation of this grid should be consistent with that of the constructor's input parameter, so see that method's description for more clarification.
    equals      
    This method compares the contents of this TilePuzzle object to the given TilePuzzle and returns true if their tile grids match. It takes in a single TilePuzzle parameter to use in the comparison, and returns false if:
        * The two tile grids have the same dimensions
        * <<<<<<< index.shtml The numbers in each grid are in the same positions ======= The grids have the same dimensions, but the numbers are in different positions. >>>>>>> 1.15
    toString      
    Returns a String that represents the current layout of the grid in String form. Each row of the grid is separated by a newline character '\n', the adjacent tiles are separated by spaces, and the blank tile is represented with an asterisk ('*') character. For example, the winning layout for a tile grid with 3 rows and 4 columns would look like the following:
                "1 2 3 4
                 5 6 7 8
                 9 10 11 *"
    There should be no leading or trailing spaces in each line of this String, and there should be no newline character after the final row.

    Please do not post in text in code tags.
    Please do not post assignments, post program code, and problems.

  • How do I best implement a comparable parameterized class?

    I am trying to implement a parameterized Wrapper class that I want to make Comparable, and the ordering is supposed to
    be consistent with equals(). How can this be done? I'm kind of lost ...
    My first approach looked like this:
    class Wrapper<T> implements Comparable<Wrapper<T>> {
      private T theObject;
      public Wrapper(T arg) { theObject = arg; }
      public boolean equals(Object other) {
        if (this == other) return true;
        if (other == null) return false;
        if (getClass() != other.getClass()) return false;
        ... comparison of theObject based on T.equals() ...
      public int hashCode() { ... }
      public int compareTo(Wrapper<T> other) {
        if (this == other) return 0;
        if (other == null) throw new NullPointerException();
        ... comparison of theObject based on T.compareTo() ...
    }This does not work, because I cannot invoke T.compareTo(), since T's bound it Object. Okay, it makes sense to perform
    comparison only against wrappers around something that is comparable to T. Next try:
    class Wrapper<T> implements Comparable<Wrapper<? extends Comparable<T>>> {
      public int compareTo(Wrapper<? extends Comparable<T>> other) {
        if (this == other) return 0;
        if (other == null) throw new NullPointerException();
        ... comparison of theObject based on T.compareTo() ...
    }Now it compiles and I can compare a Wrapper<Integer> to a Wrapper<Integer>. But I cannot compare a Wrapper<Number> to
    a Wrapper<Integer>, although the Wrapper<Number> may well contain a reference to an Integer object that is
    comparable to the Integer in the other wrapper and the comparison is meaningful in such a case. Simply for reasons
    of consistency with equals() I want to compare Wrapper<Integer> and Wrapper<Number>, but with the implementation above
    I can't:
              Wrapper<Integer> p0 = new Wrapper<Integer>(10000);
              Wrapper<Number> p2 = new  Wrapper<Number>(10000);
              boolean equ = false;
              equ = p0.equals(p2);
              equ = p2.equals(p0);     
              int less = 0;
              less = p0.compareTo(p2);
              less = p2.compareTo(p0);The error messages say:
    compareTo(Wrapper<? extends Comparable<Integer>>) in Wrapper<Integer> cannot be applied to (Wrapper<Number>)
              result = p0.compareTo(p2);
                               ^
    compareTo(Wrapper<? extends Comparable<Number>>) in Wrapper<Number> cannot be applied to (Wrapper<Integer>)
              result = p2.compareTo(p0);
                               ^Okay, a Wrapper<Number> is not comparable to a Wrapper<Integer>. Obviously, the wildcard "? extends Comparable<T>" is
    too restrictive. So I tried "? extends Comparable<?>", but then I cannot invoke T.compareTo(). Hence I use the raw
    type Comparable:
    class Wrapper<T> implements Comparable<Wrapper<? extends Comparable>> {
      public int compareTo(Wrapper<? extends Comparable> other) {
        if (this == other) return 0;
        if (other == null) throw new NullPointerException();
        ... comparison of theObject based on T.compareTo() ...
    }Now, it is asymmetric; I can pass Wrapper<Integer> to Wrapper<Number>.compareTo(Wrapper<? extends Comparable>), but I
    cannot pass Wrapper<Number> to Wrapper<Integer>.compareTo(Wrapper<? extends Comparable>). I see, Number is simply not
    comparable to anything.
    Is there a way to express that a Wrapper<T> shall be comparable to another Wrapper<U> where U is comparable to T or is
    a supertype of something that is comparable to T? The wildcard Wrapper<? super Comparable<T>> isn't what I'm looking
    for; it requires that Comparable<Integer> would be a subtype of Number, which it is not.
    Eventually the best implementation I can come up with is this one:
    class Wrapper<T> implements Comparable<Wrapper> {
      public int compareTo(Wrapper other) {
        if (this == other) return 0;
        if (other == null) throw new NullPointerException();
        ... comparison of theObject based on T.compareTo() plus a cast to Comparable<T> ...
    }As soon as I try to be more specific and require that the wrapped object must be somehow comparable I cannot get
    access to a comparable object through a non-comparable supertype any longer. I had somehow hoped that wildcards would
    help expressing things like this, but that's a misconception, right?
    Or does anybody have an idea how to express my intent in terms of wildcards or any other Java feature?

    Have you tried the following declaration:
    class Wrapper<T extends Comparable<T>> implements Comparable<Wrapper<T>> This should pass the restriction imposed on T upwards
    to the super-interface.
    Maybe that works as you expected?It's more restricted than I want because then all my wrappers would be wrappers around a comparable object and I cannot have a Wrapper<Number> any longer. Perhaps that's what I will resort to: a Wrapper, a ComparableWrapper, a CloneableWrapper, ...
    >
    BTW, what is this declaration of yours supposed to
    mean:
    class Wrapper<T> implements Comparable<Wrapper<? extends Comparable<T>>>
    I think it is a wrapper that is comparable to another wrapper and that other wrapper contains an object that is comparable to T. It does not have to be a T, it suffices that it is comparable to T.
    My gut feeling says that the use of wildcards in the
    supertype of a derived class declaration should not be
    legal, since it would render the supertype of
    Wrapper<T> into a "family" of supertypes. Doesn't make
    any sense to me, but if the compiler swallows it, then
    it's probably just my limited understanding...The use of the wildcard in not in the supertype; it is in the type argument of the type argument of the supertype. A declaration such as ... implements Comparable<? extends Wrapper<T>> would be illegal, as far as I understand wildcards.

  • Parent class not waiting for child class to finish

    hi,
    i have class a and method x in class a which calls class b. its fine till there. but before my class b's action is completed, in which i have to choose a file and display those files in jtable, the remaining lines in method x getting executed. what do you think the problem is.
    i.e. my parent's class method is completely getting executed before the child class (frame) returns the result and is closed. where do u think the problem.
    please help.

    i dont know if i made myself clear. i am giving my code below.
    class A{
    btnClick{
    pnlProductsImport _pnlProductsImport=new  pnlProductsImport(dataSource,config,parent,importFile);
    _pnlProductsImport.setVisible(true);
    _pnlProductsImport.show();
    getProducts()
    here its showing my pnlProductsImport class screen and before I close that screen, getProducts method is getting executed. as I know, the control passes from class A to pnlProductsImport at show() and when its closed, it will execute remaning lines i.e getProducts, but in this case, it shows the subclass, and immedietly, executing remaining lines. but its also fact that my subclass (pnlProductsImport) implements Runnable, but thread starts only after some time when I click on one of the buttons on the screen.... and i want that getProducts() method to execute only when subclass closes completely.
    thanks

  • Runnable v/s Thread class.

    Hi ya Folks,
    Any MAJOR difference between using the Runnable interface
    or extending the Thread class?
    Which is more beneficial.?

    From the infamous cut-n-paste archive...
    Prefer implementing Runnable to extending Thread. Think of Threads as the workers and Runnables as the job itself. You implement Runnable because your "unit of work" or whatever you want to call it IS-A Runnable -- that is, something that will do its job start-to-finish when you call run. You would only extend Thread if your class IS-A Thread -- that is, it has a reason to do everything Thread does, and you need to slightly add to or modify Thread's behavior.

Maybe you are looking for

  • PC Quicken data to MacBook Air? (and Photoshop...)

    A long time PC friend is dreading switch to Air due to much old Quicken (and Photoshop) data. Is it possible to import PC Quicken data onto a MB Air using the Mac version of Quicken? If so, does anyone have links to a 'help' resource for this purpose

  • Is there a phone number to actually speak to a human at Verizon?

    is there a phone number to actually speak to a human at Verizon?

  • Suse11.2 SAP ERP6 INSTALL  ./sapinst do not start

    hi guys i have done jdk install and /etc/profile work. and ip and hostname in /etc/hosts, export DISPLAY=IP:0.0,xhost. all are done ! but still  ./sapinst do not start!!! Starting GUIServer using:   SAPinst port         : pipe:5:8   GUIServer port   

  • DML(Update)  in a report

    I have a report, with a query that includes a ROWNUM, How can I do UPDATE of the table of the query with the printed rownum? For example, query report is: SELECT rownum, a.* from mytable a order by ......; I have to UPDATE one of column, say x of my

  • Hexadecimal error during activation of DSO from datasource

    hi guys, im facing this error during DSO data activation: Value '"1st anniversary,birthday & staff party"' (hex. '2200310073007400200061006E006E00690076006500720073') of characteristic ZTXOSIK1 contains invalid characters is there any routine that i