A problem about event-driven and multi-thread ( maybe?)

I am thinking of doing a piece of small software. I am going to write a server, storing some dynamic information. and each client (surely in different threads) has a JList, which is supposed to update itself with server, such as adding an item, etc.
a straightforward example is an IM software, each client stores a list of online buddies, and if a new client logs in, many other clients have to update the buddies list.
What is a good approach of doing that? I am thinking of adding a public method, addItem() into the thread handler, which adds a new item into the JList. but is it a good design to have a public method other than "run()" in the thread handler?
Or do I have to define a new event of new item needed to be added?
Thanks.

Actually I am just asking for how to design a good communication between the server and the client...
so just as a client A logging in, the server knows that the client A has logged in, and A,B are friends, B's friend lists should be updated, which means adding A to that list. so I am thinking have a addItem() method in the thread handler of B, so I can call ThreadHandlerB.addItem( A ) in the code of the server, since server knows that A has logged in.
or is there any good approach? And most importantly, is it a safe way to have a public method in the thread handler?
Thanks so much!

Similar Messages

  • Memory leaks and multi threading issues in managed client.

    In our company we use a lot of Oracle, and after the release of the managed provider we migrated all applications to it. First the  things were very impressive : the new client was faster, but after some days applications that uses 100MB with old client goes to 1GB and up. The memory is not the only issue, we use a lot of multi threading, and we experience connection drops and not disposal, after 1 days working one of the application had over 100 sessions on the server. I think there is something wrong with connection pool and multi threading.
    Is someone experience same problems.
    Yesterday we went back with unmanaged provider. Now things are back to normal.

    connection drops: did you try to use "Validate Connection=true" parameter in your connection string?
    the new client was faster: are you sure with this statement? Even in 64bit environment? I got quite serious performance problems when running application under 64bit process: https://forums.oracle.com/thread/2595323

  • Enterprise User and Multi Thread Server

    Hi,
    We are going to build a system which uses a configuration:
    10g2
    Enterprise User
    Multi Thread Server
    Client apps accesses db over JDBC/SSL
    Could some please share experience about issues regarding
    using Enterprise User and Multi Thread Server ?
    Is MTS transparant for Enterprise User authentication ?
    Regards,
    Cezary

    If you build simpserv with -t, and set MIN and MAXDISPATCHTHREADS, you
    should have an example of a multithreaded server.
         Scott
    Johan Philippe wrote:
    >
    We have been going to the documentation on multi-threading and contexting in servers
    on Tuxedo 7.1.
    And the impression so far is that apart from the function definitions there is
    not much information around.
    Didn't even find a simple example of a multi-threaded server in the Bea refs yet.
    Does anyone know/have such an example?
    And is anyone using multi-contexting in a server, because the limitation that
    only server-dispatched
    thread get a context puts quite a limitation on its usefullness.

  • Asynch Event Gateway not multi-threaded?

    Hi there,
    I've stumbled upon a huge problem and I would greatly
    appreciate your help otherwise I am looking at a major rework of my
    application :S
    I thought that any event gateway (asynch) would be
    multi-threaded? that is, multiple users can call the event gateway
    at the same time and this would just fire up threads of the event
    gateway and parallel processing of the cfc will occur?
    However, that is not whats happening in my application. My
    event gateway is called from a webpage and it computes (very
    complicated and time consuming data) its data and creates a file
    with a unique filename. However, if more then 1 user submits a job
    at the same time, it only takes the first job, finishes it and then
    starts working on the next job in the queue. So if there were 5
    users who submitted their jobs one after the other, the event
    gateway will take their jobs one by one which is very bad for me.
    Is there a way to have event gateway work on multiple jobs at
    the sametime??? or is this just not possible?
    I will greatly appreciate your reply. thank you
    using Coldfusion MX 7, WINXP

    My event gateway is called from a webpage and it computes (very
    complicated and time consuming data) its data and creates a file
    with a unique filename. However, if more then 1 user submits a job
    at the same time, it only takes the first job, finishes it and then
    starts working on the next job in the queue. So if there were 5
    users who submitted their jobs one after the other, the event
    gateway will take their jobs one by one
    I'm not so sure about your conclusion in the case of 5 jobs.
    The 5 jobs may start in the order in which they were triggered, but
    might end in a different order. Also, there could be some
    multithreaded processing between the first job starting and the
    last job finishing. Threads can be unpredictable worms.

  • [JS] Basic question about event listeners and event handlers

    I am very new to the whole topic of event listeners and event handlers.  I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
    Say I have an InDesign document with a text frame that is linked to an InCopy story.  Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated?  And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
    Thanks.

    Thank you, Kasyan.
    Both of those are good solutions.
    We are currently using InDesign CS4 and InCopy CS5.  I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway.  The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
    Thanks again.  You have no idea how helpful this is.  I made some promises to my boss yesterday that I later realized were  based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going  to have to retract my promises.  But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
    Richard

  • Problem in Event driven report

    Dear Gurus...I created the following procedure to implement Event Driven Reporting:
    CREATE OR REPLACE procedure ABC.eve_drv_rep as
    myPlist system.SRW_PARAMLIST;
    myIdent system.SRW.Job_Ident;
    BEGIN
    myPlist := system.SRW_PARAMLIST(system.SRW_PARAMETER('',''));
    system.srw.add_parameter(myPlist,'GATEWAY','http://192.168.1.133/reports/rwservlet);
    system.srw.add_parameter(myPlist,'SERVER','rep_appsrv_frhome1');
    system.srw.add_parameter(myPlist,'REPORT','y:\02\02\Gry_02_01.rep');
    system.srw.add_parameter(myPlist,'USERID','def/xyz@nml');
    system.srw.add_parameter(myPlist,'DESTYPE','email');
    system.srw.add_parameter(myPlist,'DESFORMAT','PDF');
    system.srw.add_parameter(myPlist,'DESNAME','[email protected]');
    myIdent := system.srw.run_report(myPlist);
    EXCEPTION
    when others then
    raise_application_error(-20001,'Error sending email.Error: '||sqlerrm);
    --Dbms_Put.Put_Line('Error sending email.Error: '||dbms_util.get_detailed_sqlerrm);
    END;
    Procedure is created successfully but when I execute this procedure, I get the following error:
    ORA-20001'Error sending email.Error: ORA-20999
    ORA-06512: at "Nml.Eve_Drv_Rep", line 17
    ORA-06512: at line 1
    Can u guess where is the problem?
    2ndly I want to know that whether I should give IP address or Application Server Machine Name in GATEWAY parameter?
    And in SERVER parameter either I should give the Application Server Machine Name or Report Server name installed on Application Server Machine?
    Lastly from where I can get the complete list of Parameters to be added in SRW.Add_Parameter like SERVER, GATEWAY etc.
    Please note that we r using Database 10g Rel.2 and Forms and Reports services on Application Services and the report being called was developed in Reports 10g.

    Hi,
    Consider this corrected code.
    REPORT zztest
    NO STANDARD PAGE HEADING
    LINE-COUNT 36(3)
    LINE-SIZE 250.
    DATA: BEGIN OF itab OCCURS 0,
    carrid TYPE sbook-carrid,
    connid TYPE sbook-connid,
    fldate TYPE sbook-fldate,
    custtype TYPE sbook-custtype,
    class TYPE sbook-class,
    bookid TYPE sbook-bookid,
    END OF itab.
    DATA a TYPE i.
    SELECT carrid connid fldate custtype class bookid
    FROM sbook INTO CORRESPONDING FIELDS OF TABLE itab.
    SORT itab.
    ULINE.
    WRITE :1 'CARRID', 20'BOOK ID', 37'CLASS'.
    ULINE.
    LOOP AT itab .
    <b>  AT NEW carrid.
        WRITE: 1 itab-carrid.
      ENDAT.
      WRITE : 20 itab-bookid.
      WRITE : 40 itab-class.</b>
      AT END OF carrid.
        ULINE.
      ENDAT.
    ENDLOOP.
    <b>Your problem was.</b>
      AT NEW carrid.
        WRITE: 1 itab-carrid.
      ENDAT.
      WRITE : <b>/</b>20 itab-bookid. "New Line <b>/</b>
      WRITE : 40 itab-class.
    Regards,
    Arun Sambargi.

  • The problem about  integrate  Portal and R/3

    Hi everyone :
       We want to achieve that our vendor can query R/3 report via our Portal. I had done SSO configuration.
       But we had about 500 vendors, it is impossible that we create 500 R/3 users for our vendors,  because the cost is too much .
       And there is another problem, vendor who had the authorization to query report can query the other vendor's data at same time. But we expect that certain vendor can query his data only.
       I think this is a general problem when integrate Portal and R/3, BW .
       Is there somebody had solved this problem or give any advice?
       Any discuss is welcome.
    Best Regards,
    Jianguo Chen

    Hi,
    I would say: get in contact with your SAP account manager anc check which options SAP can offer you...
    Normally every user using a R/3 system has to have a valid user license in that system. Expecially when you want to access control to data on user (vendor) level you nedd to identifiy the user clearly and uniquely which by standard means you need a user for every vendor.
    Hth,
    Michael

  • The problem about  integrate  Portal and R/3 : vendor query report problem

    Hi everyone :
       We want to achieve that our vendor can query R/3 report via our Portal. I had done SSO configuration.
       But we had about 500 vendors, it is impossible that we create 500 R/3 users for our vendors,  because the cost is too much .
       And there is another problem, vendor who had the authorization to query report can query the other vendor's data at same time. But we expect that certain vendor can query his data only.
       I think this is a general problem when integrate Portal and R/3, BW .
       Is there somebody had solved this problem or give any advice?
       Any discuss is welcome.
    Best Regards,
    Jianguo Chen

    Hi,
    I would say: get in contact with your SAP account manager anc check which options SAP can offer you...
    Normally every user using a R/3 system has to have a valid user license in that system. Expecially when you want to access control to data on user (vendor) level you nedd to identifiy the user clearly and uniquely which by standard means you need a user for every vendor.
    Hth,
    Michael

  • Problem About J2EE RI and PetStore Demo

    Hello ^^
    I have a problem about j2ee & petstore.
    I trird to set up sun j2ee RI 1.3.1 + pet store on win2000 or redhat.
    Everything run ok. But when I changed web port 8000 to any port (included
    80),
    j2ee ri server showed the error message below :
    java.net.ConnectException: Connection refused: connect
    java.security.PrivilegedActionException: javax.servlet.ServletException:
    An error occurred while evaluating custom action attribute "items" with
    value "${catalog.categories.list}": An error occurred while getting
    property "categories" from an instance of class
    com.sun.j2ee.blueprints.catalog.client.CatalogHelper
    I used root to start j2ee & cloudscape on linux,
    and changed database to postgresql, too.
    but the error is the same.
    How to solve this problem ??
    Thank you ~~
    Jovi

    Hi,
    I dont know how useful my reply would be since the question was posted about 2 yrs back, but just wanted to reply in case somebody faces the same problem.
    If you change the web port to some other port (other than 8000) then please check the sun-j2ee-ri.xml files. Actually the CatalogDAOSQL.xml is read using a url which includes the port you are running the server on. So, you need to change the port even in the sun-j2ee-ri.xml file.
    One of the sun-j2ee-ri.xml files, where you need to make the change is in the $PETSTORE_HOME/src/apps/petstore/src/sun-j2ee-ri.xml file.
    Other one is in $PETSTORE_HOME/src/apps/supplier/src/sun-j2ee-ri.xml file.
    Look for other sun-j2ee-ri.xml files where the url is hardcoded. (I think the two sun-j2ee-ri.xml files mentioned above, are the only places you need to make the change, but still look for other files in case i have missed)
    Change those urls and redeploy the ears.
    Hope this solves the problem.
    Regards,
    Archit

  • Aggregate Storage And Multi-Threading/Multi-Core Systems

    Please pardon if this question has been asked before, but the Forum search is not returning any relevant results.
    We are in the process of purchasing hardware for an 11.1.2 Essbase environment. We are going 64-bit, on Windows 2008, with either 32 GB or 64 GB of system RAM. The debate we are having is the number of CPUs and cores per CPU. We have not built any ASO databases as of yet, but we plan to launch a major BSO to ASO conversion project once 11.1.2 is off the ground here.
    Historically, with BSO, we did not see performance improvements significant enough to justify the cost of additional CPUs when we ran calcs on multi-CPU systems vs. single or dual CPU systems, even when the settings and design should have taken the most advantage of BSO's multi-threading capabilities. However, it would seem that ASO's design may be able to make better use of multi-core systems.
    I know that there are a lot of factors behind any system's performance, but in general, is ASO in 11.1.2 written well enough to make it worthwhile to consider, say, a four CPU, total 16 core system vs. a 2 CPU, total four core system?

    Grand central dispatch - infancy, not really doing its job, and I don't think apps have to be specifically written for HT, but they do have to not do things that they use to - prevent threads from going to sleep! or be parked.
    high usage is not necessarily high efficiency. often the opposite.
    Windows 7 seems to be optimized for multi-core thanks to a lot of reworking. Intel wants and knows it isn't possible to hand code, that the hardware has to be smarter, too. But the OS has a job, and right now I don't think it does it properly. Or handle memory.
    Gulftown's 12MB cache will help, and over all should be 20% more efficient doing its work.
    With dual processors, and it doesn't look like there are two quick path bridges, data shuffling has led to memory thrashing. Use to be page thrashing with not enough memory. Then core thrashing but having the cores, but not integrated (2008 is often touted as being greatest design so far, but it was FOUR dual-cores, 2009 was the first with a processor that really was new design and (native) 4-core.
    One core should be owned by the OS so it is always available for its own work and housekeeping.
    The iTunes audio bug last year showed how damaging and not to implement code and how a thread could usurp processing and add a high cpu temperature while basically doing nothing, sort of a denial of service attack on the processor - those 80*C temps people had.
    All those new technology features under development and not like OpenCL, GCD and even OpenGL are tested, mature but rather 1.0 foundation for the future. A year ahead of readiness.

  • Indesign and multi threaded cpu support??????????

    When the indesign will finally support multi-core processors?????? It is tragic that adobe dont have any support for multi-core cpu and that this products cost thousends $$$$$!!!!!!!!!!!!!!! Only premiere and some photoshop function support multi-core cpu.

    If you are good freelancer you can get money spent on CS back in a month. So I would not call this software expensive. What concerns multi threaded cpu support I believe that programming tools as well as operating systems need to evolve. I am sure that we will get better support in this matter in close future.

  • ABOUT "connecttion lifetime" and "clean thread"

    Hi expert, can you explain what "connection lifetime" and "clean thread" mean in JDBC Connector service to me ?thanks

    Hi Justin,
    Though I am no developer, here's what I found:
    The JDBC Connector Service is a resource adapter based on the Java Database Connectivity (JDBC) standard to enable you to connect to databases. It creates, manages, and stores in a pool the DataSource objects that are used to obtain physical connections to a database.
    Next comes a document type definition (DTD) which is used for producing XML files for the creation of DataSource objects. What you asked are elements used to define this DTD. Explanation is:
    1. ELEMENT expiration-control (connection-lifetime, run-cleanup-thread)
    Connection-lifetime element specifies a period in seconds, after which the connection expires.
    Used in: expiration-control
    2. ELEMENT run-cleanup-thread (#PCDATA)
    Isolation-level element determines a transaction isolation level for the DataSource object. If you do not specify the isolation level, the system uses the default isolation level of the used database.
    Used in: data-source
    ELEMENT isolation-level (#PCDATA)
    Sql-engine element defines what type of connection the system should return.
    Valid values:
    Open_SQL u2013 the system returns a DBI CommonConnection
    Native_SQL u2013 the system returns a DBI DirectConnection
    Vendor_SQL u2013 the system returns a standard connection from JDBC driver (not using DBI at all)
    Used in: data-source
    Please follow Link: [http://help.sap.com/saphelp_nw2004s/helpdata/en/64/0bee3da7138e5be10000000a114084/frameset.htm]
    Please reward points if that helped.
    regards, Sean.

  • Problem in Events (Create and Change)

    Hi all,
    I have developed a worlflow for transaction FV50. Now the problem is that when i create a parking document a mali is sent to approver for approval.
    Now suppose if approver doesn't do any action on the workitem which he had in his inbox and initiator changes the same document then the previous mail has to be removed and new mail has to be present in the approver inbox.
    I tried using fork with two branches.
    In one branch i kept entire flow and in one branch i have created a WAIT for event. It worked i.e. when i create a doc approver is receiving mail..but when i change the same doc then old mail is deleting from his inbox but he is not getting new mail for the changes he made for the document.
    So please help me how to achieve the same.
    Regards,
    Sagar.

    Hi Raj,
    Thaks for ur reply.
    And it helped me a lot.
    One more thing i need to know is regarding FORK. For the first i am using the same in WF.
    As i said In one branch i have whole logic and in other branch i have wait for event.
    Do i need to do have the same process which is done for create in change branch also.
    Please explain how FORK works.
    Thanks.
    Sagar

  • Are anonymous classes reentrant and multi-thread safe?

    Consider the following code. Please let me know how does this code behave wrt to reentrancy and MT. My main confusion is with the "static" keyword.
    Appreciate any inputs. Thanks in advance.
    public abstract class AnAbstract {
       public abstract int abstractFoo();
       public static AnAbstract AnAbstractImpl = new AnAbstract() {
          public int abstractFoo() {
             //do stuff here....
             return 0;
       public static void main(String [] args) {
          System.out.println(AnAbstract.AnAbstractImpl.abstractFoo());
    }

    static has nothing to do with threading.
    Nor is there anything special about anonymous classes.
    As implemented the class is safe.
    However, given that the class is going to do more than the code that you posted the actual implementation might not be safe.

  • Problem about Triggering BPM and Process monitor

    Hi all,
    I am new on the BPM domain. Now i got some problem working on it.
    First, i want to execute a FM or Program in ECC, and then trigger the process of BPM, how to do this?
    or maybe i can say like this, i want to start a BPM from ECC screen, how could i do?
    Second, the requester could find the completed tasks in UWL with some simple text only,
    if he wants to see the whole process status, is that possible?
    Regards,
    Fisher

    Hi Harsha,
    Thx for your reply.
    For First, is the URL which in Process Repository, after clicking "start process", something like "http://www.example.org/bpem/..... "?
    but seems i cannot open the URL for detail XML data. Could you give some more details?
    For Second, go to UWL page, in Tasks tab, choose "completed tasks" in first dropdown box, you can get the task list then.
    And it returns only "priority, completion date, status".
    If the task is in progress, yes, process visualization will picture the state of the process.
    But my customers (requesters), not admin, want to see the diagram after they submit, with status better. Any suggestion?
    Regards,
    Fisher

Maybe you are looking for

  • Security exception while running the java client for a secured web service.

    hi, I created a proxy for a secured web service. When I run the client java program I am getting the following exception : java.io.IOException: could not load the default-keystore.jks file because The keystore file is tampered or password is incorrec

  • Mac update to 4.4.1

    I am operating on a Mac with PSE 6. I currently have the 4.3.1 version of Camera RAW. When I downloaded the update to 4.4.1 I get the error message "could not complete your request because Photoshop does not recognize this type of file". Any suggesti

  • PDF conversion with PDF2ID; Hypertext not working when exported back to pdf.

    I have done a PDF conversion with PDF2ID, however Hypertext is not working when I exported it back to pdf. I am using the PDF2ID plug-in program to redo all the product booklets for our company as the hypertext did not work when downloaded to any sma

  • Connecting a G4 to a TV

    Can someone please let me know of any extra hardware or software requirments to hook up my old G4 (400MHz) to a TV? Thanks.

  • Version that iFS 1.1 support and Character_set

    Hello, - Which version of SUN, Linux, Compaq 64 are supported with iFS 1.1 ? - What is the implication of the CHARACTER_SET that had been defined during the installation for the clients ? - Does the index language will be the same for all the documen