Accessing the same object from multiple classes.

For the life of me I can't workout how I can access things from classes that haven't created them.
I don't want to have to use "new" multiple times in seperate classes as that would erase manipulated values.
I want to be able to access and manipulate an array of objects from multiple classes without resetting the array object values. How do I create a new object then be able to use it from all classes rather than re-creating it?
Also I need my GUI to recognize the changes my buttons are making to data and reload itself so they show up.
All help is good help!
regards,
Luke Grainger

As long as you have a headquarters it shouldn't be to painfull. You simply keep a refrence to your ShipDataBase and Arsenal and all your irrellevant stuff in Headquarters. So the start of your Headquarters class would look something like:
public class Headquarters{
  public Arsenal arsenal;
  public ShipDatabase db;
//constructor
  public Headquarters(){
    arsenal = new Arsenal(this, ....);
    db = new ShipDatabase(...);
//The Arsenal class:
public class Arsenal{
  public Headquarter hq;
  public Arsenal(Headquarter hq, ....){
    this.hq = hq;
    .Then in your ShipDatabase you should, as good programing goes, keep the arraylist as a private class variable, and then make simple public methods to access it. Methods like getShipList(), addToShipList(Ship ship)....
So when you want to add a ship from arsenal you write:
hq.db.addToShipList(ship);
.Or you could of course use a more direct refrence:
ShipDatabase db = hq.db;
or even
ShipList = hq.db.getShipList();
but this requires that the shiplist in the DB is kept public....
Hope it was comprehensive enough, and that I answered what you where wondering.
Sjur
PS: Initialise the array is what you do right here:
//constructor
shipList = new Ship[6];
shipList[0] = new Ship("Sentry", 15, 10, "Scout");
" " " "etc
shipList[5] = new Ship("Sentry", 15, 10, "Scout");PPS: To make code snippets etc. more readable please read this article:
http://forum.java.sun.com/faq.jsp#messageformat

Similar Messages

  • Accessing the same data from multiple threads

    Hi
    In the following program the task5 routine takes ~3s to complete, when I uncomment the t2 lines it takes 11s (this is on a quad-core x86/64 machine). Since there is no explicit synchronization I was expecting 3s in both cases.
    public static int sdata;
    public static void Task5()
    int acc = 0;
    for (int i = 0; i < 1000000000; ++i)
    sdata = i;
    acc += sdata;
    [STAThread]
    static void Main()
    Stopwatch sw = new Stopwatch();
    sw.Start();
    Thread t1 = new Thread(new ThreadStart(Task5));
    // Thread t2 = new Thread(new ThreadStart(Task5));
    t1.Start();
    // t2.Start();
    t1.Join();
    // t2.Join();
    sw.Stop();
    System.Diagnostics.Debug.WriteLine(sw.ElapsedMilliseconds.ToString());
    Why are these threads blocking each other?

    This is loosely a duplicate of https://social.msdn.microsoft.com/Forums/en-US/cd00284d-3da3-457e-8926-c490e7ca6d92/atomic-loadstore?forum=vclanguage
    I answered you in detail over at the other thread.
    But the short version is that the threads are competing for access to system memory, specifically at the memory location of sdata.  This demonstrates how to spoil the benefits of not having to write-through from your CPU cache to system memory.  CPU
    Caches are wonderful things.  CPU cache memory is WAY faster than system memory.

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

  • How do I use multiple classes to access the same object?

    This should be staightforward. I have and object and I have multiple GUIs which operate on the same object. Do all the classes creating the GUIs need to be inner classes of the data class? I hope this question makes sense.
    Thanks,
    Mike

    public final class SingletonClass {
    private static SingletonClass instance;
    private int lastIndex = 10;
    public final static SingletonClass getInstance()
    if (instance == null) instance = new SingletoClass();
    return instance;
    public int getLastIndex() {
    return lastIndex;
    }1) This won't work since one could create a new SingletonClass. You need to add a private constructor. Also, because the constructor is private the class doesn't have to be final.
    2) Your design isn't thread-safe. You need to synchronize the access to the shared variable instance.
    public class SingletonClass {
        private static SingletonClass instance;
        private static Object mutex = new Object( );
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            synchronized (mutex) {
                if (instance == null) {
                    instance = new SingletonClass();
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }if you are going to create an instance of SingletonClass anyway then I suggest you do it when the class is loaded. This way you don't need synchronization.
    public class SingletonClass {
        private static SingletonClass instance=new SingletonClass();
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }If you don't really need an object, then you could just make getLastIndex() and lastIndex static and not use the singleton pattern at all.
    public class SingletonClass {
        private static int lastIndex = 10;
        private SingletonClass() { }
        public static int getLastIndex() {
            return lastIndex;
    }- Marcus

  • How to access the objects from  multiple classes in  ABAP Objects

    <b> Give me The scenario and solution to the above problem </b>

    In abap OO you can have only one super class.
    multiple inheritence can be acheived by inheriting multiple interfaces.
    abap OO is similler to that of JAVA in inheritence.
    so you can not have classes a and b both as super at same time for a class.
    however if still you want to acheive your perpose then you can do it using heirarchical inheritance where b inherits a and c inhrites b. so this way public methods will be accesible in c
    do revert back if any other doubt.
    check this link for more clear picture:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/frameset.htm
    regards.
    kindly close the thread if problem by awarding points on left side.
    Message was edited by: Hemendra Singh Manral

  • How do I call methods with the same name from different classes

    I have a user class which needs to make calls to methods with the same name but to ojects of a different type.
    My User class will create an object of type MyDAO or of type RemoteDAO.
    The RemoteDAO class is simply a wrapper class around a MyDAO object type to allow a MyDAO object to be accessed remotely. Note the interface MyInterface which MyDAO must implement cannot throw RemoteExceptions.
    Problem is I have ended up with 2 identical User classes which only differ in the type of object they make calls to, method names and functionality are identical.
    Is there any way I can get around this problem?
    Thanks ... J
    My classes are defined as followes
    interface MyInterface{
         //Does not and CANNOT declare to throw any exceptions
        public String sayHello();
    class MyDAO implements MyInterface{
       public String sayHello(){
              return ("Hello from DAO");
    interface RemoteDAO extends java.rmi.Remote{
         public String sayHello() throws java.rmi.RemoteException;
    class RemoteDAOImpl extends UnicastRemoteObject implements RemoteDAO{
         MyDAO dao = new MyDAO();
        public String sayHello() throws java.rmi.RemoteException{
              return dao.sayHello();
    class User{
       //MyDAO dao = new MyDAO();
       //OR
       RemoteDAO dao = new RemoteDAO();
       public void callDAO(){
              try{
              System.out.println( dao.sayHello() );
              catch( Exception e ){
    }

    >
    That's only a good idea if the semantics of sayHello
    as defined in MyInterface suggest that a
    RemoteException could occur. If not, then you're
    designing the interface to suit the way the
    implementing classes will be written, which smells.
    :-)But in practice you can't make a call which can be handled either remotely or locally without, at some point, dealing with the RemoteException.
    Therefore either RemoteException must be part of the interface or (an this is probably more satisfactory) you don't use the remote interface directly, but MyInterface is implemented by a wrapper class which deals with the exception.

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • Parallel run of the same function from multiple jobs

    Hello, everyone!
    I have a function which accepts a date range, reads invoices from a partitioned by date table and writes output to a partitioned by invoice table. Each invoice can have records only with one date, so both tables may have one invoice only in one partition, i.e. partitions do not overlap. Function commits after processing each date. The whole process was running about 6 hrs with 46 million records in source table.
    We are expecting source table to grow over 150 million rows, so we decided to split it into 3 parallel jobs and each job will process 1/3 of dates, and, as a result, 1/3 of invoices.
    So, we call this function from 3 concurrent UNIX jobs and each job passes its own range of dates.
    What we noticed, is that even if we run 3 jobs concurrently, they do not run this way! When 1st job ends after 2 hrs of run, the number of commited rows in the target table is equal to the number of rows inserted by this job. When 2nd job ends after 4 hrs of run, the number of rows in the target table is equal the summary of two jobs. And the 3rd job ends only after 6 hrs.
    So, instead of improving a process by splitting it into 3 parallel jobs we ended up having 3 jobs instead of one with the same 6 hrs until target table is loaded.
    My question is - How to make it work? It looks like Oracle 11g is smart enough to recognize, that all 3 jobs are calling the same function and execute this function only once at the time. I.e. it looks like only one copy of the function is loaded into the memory at the same even if it called by 3 different sessions.
    The function itself has a very complicated logic, does a lot of verifications by joining to another tables and we do not want to maintain 3 copies of the same code under different names. And beside this, the plan is that if with 150 mln rows we will have a performance problem, then split it to more concurrent jobs, for example 6 or 8 jobs. Obviously we do not want to maintain so many copies of the same code by copying this function into another names.
    I was monitoring jobs by quering V$SESSION and V$SQLAREA ROWS_PROCESSED and EXECUTIONS and I can see, that each job has its own set of SID's (i.e. runs up to 8 parallel processes), but number of commited rows is always eqal to the number of rows from the 1st job, then 2nd+1st, etc. So, it looks like all processes of 2nd and 3rd jobs are waiting until 1st one is done.
    Any ideas?

    OK, this is my SQL and results (some output columns are ommited as irrelevant)
    SELECT
            TRIM ( SESS.OSUSER )                                                        "OSUser"
          , TRIM ( SESS.USERNAME )                                                      "OraUser"
          , NVL(TRIM(SESS.SCHEMANAME),'------')                                         "Schema"
          , SESS.AUDSID                                                                 "AudSID"
          , SESS.SID                                                                    "SID"
          , TO_CHAR(SESS.LOGON_TIME,'HH24:MI:SS')                                       "Sess Strt"
          , SUBSTR(SQLAREA.FIRST_LOAD_TIME,12)                                          "Tran Strt"
          , NUMTODSINTERVAL((SYSDATE-TO_DATE(SQLAREA.FIRST_LOAD_TIME,'yyyy-mm-dd hh24:mi:ss')),'DAY') "Tran Time"
          , SQLAREA.EXECUTIONS                                                          "Execs"
          , TO_CHAR(SQLAREA.ROWS_PROCESSED,'999,999,999')                               "Rows"
          , TO_CHAR(TRAN.USED_UREC,'999,999,999')                                       "Undo Rec"
          , TO_CHAR(TRAN.USED_UBLK,'999,999,999')                                       "Undo Blks"
          , SQLAREA.SORTS                                                               "Sorts"
          , SQLAREA.FETCHES                                                             "Fetches"
          , SQLAREA.LOADS                                                               "Loads"
          , SQLAREA.PARSE_CALLS                                                         "Parse Calls"
          , TRIM ( SESS.PROGRAM )                                                       "Program"
          , SESS.SERIAL#                                                                "Serial#"
          , TRAN.STATUS                                                                 "Status" 
          , SESS.STATE                                                                  "State"
          , SESS.EVENT                                                                  "Event"
          , SESS.P1TEXT||' '||SESS.P1                                                   "P1"
          , SESS.P2TEXT||' '||SESS.P2                                                   "P2"
          , SESS.P3TEXT||' '||SESS.P3                                                   "P3"
          , SESS.WAIT_CLASS                                                             "Wait Class"
          , NUMTODSINTERVAL(SESS.WAIT_TIME_MICRO/1000000,'SECOND')                      "Wait Time"
          , NUMTODSINTERVAL(SQLAREA.CONCURRENCY_WAIT_TIME/1000000,'SECOND')             "Wait Concurr"
          , NUMTODSINTERVAL(SQLAREA.CLUSTER_WAIT_TIME/1000000,'SECOND')                 "Wait Cluster"
          , NUMTODSINTERVAL(SQLAREA.USER_IO_WAIT_TIME/1000000,'SECOND')                 "Wait I/O"
          , SESS.ROW_WAIT_FILE#                                                         "Row Wait File"
          , SESS.ROW_WAIT_OBJ#                                                          "Row Wait Obj"
          , SESS.USER#                                                                  "User#"
          , SESS.OWNERID                                                                "OwnerID"
          , SESS.SCHEMA#                                                                "Schema#"
          , TRIM ( SESS.PROCESS )                                                       "Process"
          , NUMTODSINTERVAL(SQLAREA.CPU_TIME/1000000,'SECOND')                          "CPU Time"
          , NUMTODSINTERVAL(SQLAREA.ELAPSED_TIME/1000000,'SECOND')                      "Elapsed Time"
          , SQLAREA.DISK_READS                                                          "Disk Reads"
          , SQLAREA.DIRECT_WRITES                                                       "Direct Writes"
          , SQLAREA.BUFFER_GETS                                                         "Buffers"
          , SQLAREA.SHARABLE_MEM                                                        "Sharable Memory"
          , SQLAREA.PERSISTENT_MEM                                                      "Persistent Memory"
          , SQLAREA.RUNTIME_MEM                                                         "RunTime Memory"
          , TRIM ( SESS.MACHINE )                                                       "Machine"
          , TRIM ( SESS.TERMINAL )                                                      "Terminal"
          , TRIM ( SESS.TYPE )                                                          "Type"
          , SQLAREA.MODULE                                                              "Module"
          , SESS.SERVICE_NAME                                                           "Service name"
    FROM    V$SESSION    SESS
    INNER JOIN V$SQLAREA    SQLAREA  
       ON SESS.SQL_ADDRESS  = SQLAREA.ADDRESS
       and UPPER(SESS.STATUS)  = 'ACTIVE'
    LEFT JOIN  V$TRANSACTION  TRAN
       ON  TRAN.ADDR         = SESS.TADDR
    ORDER BY SESS.OSUSER
            ,SESS.USERNAME
            ,SESS.AUDSID
            ,NVL(SESS.SCHEMANAME,' ')
            ,SESS.SID
    AudSID     SID     Sess Strt     Tran Strt     Tran Time     Execs     Rows     Undo Rec     Undo Blks     Sorts     Fetches     Loads     Parse Calls     Status     State     Event     P1     P2     P3     Wait Class     Wait Time     Wait Concurr     Wait Cluster     Wait I/O     Row Wait File     Row Wait Obj     Process     CPU Time     Elapsed Time     Disk Reads     Direct Writes     Buffers     Sharable Memory     Persistent Memory     RunTime Memory
    409585     272     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED SHORT TIME     PX Deq: Execute Reply     sleeptime/senderid 200     passes 2     0     Idle     0 0:0:0.436000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     7     21777     22739     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     203     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.9674000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     25     124730     4180     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     210     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.11714000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     24     124730     22854     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     231     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.4623000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     46     21451     4178     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     243     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED SHORT TIME     PX qref latch     function 154     sleeptime 13835058061074451432     qref 0     Other     0 0:0:0.4000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21451     3550     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     252     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.19815000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     49     21451     22860     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     273     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.11621000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     22     124730     4182     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     277     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 20     blocks 125     requests 125     User I/O     0 0:0:0.242651000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     39     21451     4184     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     283     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.2781000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     42     21451     3552     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     295     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.24424000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     40     21451     22862     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409585     311     22:30:01     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.15788000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     31     21451     22856     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     242     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITED KNOWN TIME     PX Deq: Execute Reply     sleeptime/senderid 200     passes 1     0     Idle     0 0:0:0.522344000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     28     137723     22736     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     192     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.14334000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     31     21462     4202     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     222     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.16694000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     37     21462     4194     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     233     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.7731000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     44     21462     4198     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     253     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 21     blocks 125     requests 125     User I/O     0 0:0:0.792518000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     39     21462     4204     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     259     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.2961000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21462     4196     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409586     291     22:29:20     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq Credit: send blkd     sleeptime/senderid 268566527     passes 1     qref 0     Idle     0 0:0:0.9548000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     35     21462     4200     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     236     22:15:36     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Table Q Normal     sleeptime/senderid 200     passes 2     0     Idle     0 0:0:0.91548000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     25     124870     22831     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     207     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Execution Msg     sleeptime/senderid 268566527     passes 3     0     Idle     0 0:0:0.644662000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     43     21423     4208     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     241     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     PX Deq: Execution Msg     sleeptime/senderid 268566527     passes 3     0     Idle     0 0:0:0.644594000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     47     21423     4192     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448
    409587     297     22:30:30     22:15:36     0 0:14:52.999999999     302     383,521               305     0     1     3598          WAITING     db file parallel read     files 20     blocks 109     requests 109     User I/O     0 0:0:0.793261000     0 0:0:1.124995000     0 0:0:0.0     0 1:56:15.227863000     12     21316     4206     0 0:25:25.760000000     0 2:17:1.815044000     526959     0     25612732     277567     56344     55448Here I found one interesting query http://www.pythian.com/news/922/recent-spike-report-from-vactive_session_history-ash/
    But it does not help me

  • Can I access the same library from 2 computers?

    I just purchased and installed Photoshop Elements 10 on my main computer at home.  Awesome tool!
    I just loaded up over 25,000 pictures taken over the last 12 years and am slowly going through the task of tagging them.  My question is as follows:
    If install on a second computer, how do I access the library from the main computer?  I am thinking that I can tag come pics during my lunch hour and get through this faster at the office but how do I move the library from one computer to the next? 
    I don't think the library is actually "moveable".  Does it not just sort what is already on my main computer? 
    All suggestions welcome!

    If your photos and catalog file are on an external HD, then you would have to bring the external HD wherever you want and PSE will work, provided that the drive letters are the same on both computers. (Example, if the external HD is E:\ on your home computer, it would have to be E:\ on the other computer).
    You can move the catalog file and everything else in that folder via Windows. If you need to move the photos, this must be done in PSE (Folder Location View).

  • Accessing the same mail from 2 different accounts?

    I have two accounts set up on my Mac: Adminstrator (under which all my email accounts live); and a separate "writing" account where I do...what else...WRITING.
    Is there any way to alter the mail preferences to allow complete access to the administrator's email from the writing account? This would allow me to check/send email using the SAME email accounts from either mac account (so I'd see the same inboxes and email folders and their assorted messages).

    It can (you might want to ask whomever handles your accounts if they have considered IMAP. POP is simply not as flexible. Many major email providers use it as well as private ones. Gmail, MobileMe, AOL are all IMAP.)
    Set both accounts up with the same information. Go into both of them and go to Mail > Preferences > Accounts > Advanced and ensure that "Remove copy from server after retrieving a message" is NOT checked. Otherwise you won't get all the messages in both places.

  • Controlling the same output from multiple locations in vi

    Hi
    I have a very basic question which I do not seem to find the answer to though.
    When programming a VI for measurement and control using a standard DAQ device, for example 6281 I
    often want to control the same digital out pin from various places in the program.
    F.ex. In the beginning I want P0,0 to be high, then later somewhere deep in the program in a while loop I want
    to set P0,0 to low. How do I do this. I keep getting the message that the resource is reserved.
    This I have the same question with AI, AO and Digital in.
    The DAQassistant does not work and doing this more manually by creating a task, stopping it and clearing it has been problematic.
    Can anyone help? Hopefully with a demonstration VI if you have it?
    Thanks for reading all the way down though  

    You should create a functional global that stores tasks for each port.
    In the following image I have some code that should work.
    It looks up the addressed port and creates a new task if needed, otherwise it will call the old task.
    Be sure to call this VI with 'Stop?'=True at the end of your program.
    Ton
    Message Edited by TonP on 10-11-2008 08:41 PM
    Message Edited by TonP on 10-11-2008 08:42 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    DO access.png ‏15 KB

  • SLT Replication for the same table from Multiple Source Systems

    Hello,
    With HANA 1.0 SP03, it is now possible to connect multiple source systems to the same SLT Replication server and from there on to the same schema in SAP HANA - does this mean same table as well? Or will it be different tables?
    My doubt:
    Consider i am replicating the information from KNA1 from 2 Source Systems - say SourceA and SourceB.
    If I have different records in SourceA.KNA1 and SourceB.KNA1, i believe the records will be added during the replication and as a result, the final table has 2 different records.
    Now, if the same record appears in the KNA1 tables from both the sources, the final table should hold only 1 record.
    Also, if the same Customer's record is posted in both the systems with different values, it should add the records.
    How does HANA have a check in this situation?
    Please throw some light on this.

    Hi Vishal,
    i suggest you to take a look to SAP HANA SPS03 Master Guide. There is a comparison table for the three replication technologies available (see page 25).
    For Multi-System Support, there are these values:
    - Trigger-Based Replication (SLT Replication): Multiple source systems to multiple SAP  HANA instances (one  source system can be connected to one SAP HANA schema only)
    So i think that in your case you should consider BO Data Services (losing real-time analytics capabilities of course).
    Regards
    Leopoldo Capasso

  • I downloaded a song from an iTunes on my iPod Touch, and I want to know if I can access the same song from my computer to make a playlist?

    I downloaded/bought a song from an iTunes app on my iPod Touch, and I want to know if I can access the song on my home computer to make a playlist and cd?

    I added the song "Let Me Take You Home Tonight" by Boston by going to the iTunes Music Store and purchasing it as a ringtone.  If you do it from your computer you have to sync it to your iPod Touch.  Then in the alam sounds panel there is a place for "purchased"  Your song should appear there.

  • Is there a way to work on the same project from multiple macs?

    I was hoping to save a project that I was working in to the Cloud and then downlpad it to my other Mac. Can't seem to figure it out.

    Not sure what your question has to do in respect to Apple networking, but if you're asking can you use your Xbox 360 on a wireless network (regardless of the router's manufacturer) to access different Xbox Live! accounts, then the answer is yes.

  • Two Threads Sharing the Same Object

    I am learning Java multithreading recently and I really hit the wall when I came to synchronizing data using the synchronized keyword. According to the explanation, synchronized will only work when 2 or more threads are accessing the same object. If there are accessing 2 different objects, they can run the synchronized method in parallel.
    My question now is how to make sure for synchronized method to work, I am actually working with the same and only one object??
    Imagine this:
    Two person with the same account number are trying to access the very ONE account at the same time.
    I suppose the logic will be:
    Two different socket objects will be created. When it comes to the login or authentication class or method, how can I make sure in term of object that the login/authentication class or method will return them only ONE object (because they share the same account), so that they will be qualified for using the synchronized method further down the road?
    Thanks in advance!

    Actually your understanding is wrong. Consider:
    public class MyClass {
      private int someInt;
      private float someFloat;
      private synchronized void someMethod(final int value) {
        if (value > 2000) someInt = 2000;
      private synchronized void someOtherMethod(final float value) {
        if (value > 2.0) someFloat = 1.999f;
    }YOu might think that two different threads can enter this code, one can enter in someOtherMethod() while one is in someMethod(). That is wrong. The fact is that synchronization works by obtaining synchronization locks on a target object. In this case by putting it on the method declaration you are asking for the lock on the 'this' object. This means that only one of these methods may enter at a time. This code would be better written like so ...
    public class MyClass {
      private int someInt;
      private float someFloat;
      private void someMethod(final int value) {�
        synchronized(someInt) {
          if (value > 2000) someInt = 2000;
      private void someOtherMethod(final float value) {
        synchronized(someFloat) {
          if (value > 2.0) someFloat = 1.999f;
    }In this manner you are only locking on the pertinent objects to the method and not on 'this'. This means that both methods can be entered simultaneously by two different threads. However watch out for one little problem.
    public class MyClass {
      private int someInt;
      private float someFloat;
      private void someMethod(final int value) {�
        synchronized(someInt) {
          if (value > 2000) {
            someInt = 2000;
            synchronized (someFloat) {
              someFloat = 0.0f;
      private void someOtherMethod(final float value) {
        synchronized(someFloat) {
          if (value > 2.0) {
            someFloat = 1.99999f;
            synchronized (someInt) {
              someInt = 0;
    }In this case you can have a deadlock. If two threads enter one of these methods at the same time one would be waiting on the lock for someInt and the other on the lock for someFloat. Neither would proceed. The solution to the problem is simple. Acquire all locks in alphabetical order before you use the first.
    public class MyClass {
      private int someInt;
      private float someFloat;
      private void someMethod(final int value) {�
        synchronized (someFloat) {
          synchronized(someInt) {
            if (value > 2000) {
              someInt = 2000;
              someFloat = 0.0f;
      private void someOtherMethod(final float value) {
        synchronized(someFloat) {
          if (value > 2.0) {
            someFloat = 1.99999f;
            synchronized (someInt) {
              someInt = 0;
    }In this manner one thread will block waiting on someFloat and there can be no deadlock.

Maybe you are looking for

  • My iPhone 5 wont allow me to slide across so i can't gain access

    my iPhone 5 wont slide across so i can't gain access. can you help?

  • E71 with TT6?

    Hi All I have just got TomTom 6 on my E71 and am wondering which GPS Reviever to get - either the Nokia LD 4W or the TomTom Mk2 Either way I am wanting to know if he E71 will work in the following set up? Connected to the Built in Bluetooth Phone kit

  • Photoshop interface won't scale back to macbook screen size after screen change (27")

    I have a macbook pro and use a larger 27" screen for working in Photoshop for example. So when i close Photoshop whilst using the large screen, it wouldnt scale when I go back to laptop screen mode. So if i forget to resize the window, it will appear

  • Machine Certificate Autoenroll

    Hello All, I was using an Apple Script to Auto-enroll OS X 10.6 in our Microsoft PKI certificate infrastructure (Machines certificate).  The script created all the needed cert request parameters automatically, submitted it via the web based certifica

  • Memory cleaning help

    hi i just whant to ask should i use memory cleaning and how many time a week and is clearing your event log good because it helps to make my blackberry faster