Queues threads semaphores work.

I want to do a discrete event simulation, that receives an argument, a costumer, puts in a queue for a random time, and checks if the consumer is available for consuming the client. The consumer is limited to a certain range of clients. The clientes inside do consumer wait for a random time before exiting the consumer.
General Ideia :
while (Time!=close)
                    {\\Generate customer thread;
                     \\Insert on queue
                     \\Sleep
                     \\go to consumer} The project is based on consumer-producer from java tutorial

are you looking for venture capital?

Similar Messages

  • Are Queues thread safe

    Hi all,
    Are Queues thread safe i.e. are enqueue, dequeue etc atomic?
    I'm looking to use Queues to transfer object states between concurrent loops, but am concerned whether I need to protect access via a semaphore.
    Thanks
    Phill
    Solved!
    Go to Solution.

    Hi all,
    I've been discussing transfering the state of an object between concurrent loops here and was hoping to use a single element queue.
    I'm still a little worried about a context switch while I'm updating the status of the object in the area highlighted.
    Would I still need a semaphore lock to ensure the data integrity of the queue between the flush and enqueue in case the data loop sneaks in and tries to read the queue?

  • Java threading problem... threads only work on 1 processor

    I've got a iterative deepening problem that i have to parallelize. As far as i know i did everything correctly however everything seems to be running on 1 processor instead of 2 processors. As far as i know i am using threads (-Xprof either defines them as thread-1 thread-2 or pool1-thread1,depending on the method used for issueing)
    the worker thread is:
    public int solutionsT(Board board, int currentDepth) {
            int temp = 0;
            int result = 0;
            if (board.distance() == 0) {
               return 1;
            if (board.distance() > board.bound()) {
                return 0;
            Board[] children = board.makeMoves();
            result = 0;
            for (int i = 0; i < children.length; i++) {
                if (children[i] != null) {
                    temp = solutionsT(children, currentDepth + 1);
    if(temp != 0){
    result += temp;
    return result;
    public void run() {
    int temp =0;
    int i = 0;
    while(true){
    while(bag.size() !=0){
    bag.putSolution(solutionsT(bag.get(),1));
    try{   
    barrier.await();
    }catch(Exception e){}
    it get's it's input from a bag that is filled before the iteration begins. (once the bag is filled it trips a barrier) this worker thread is a implementation of Runnable
    This piece of code is used to make the thread object and to issue it
    public SolutionThread(int numberOfThreads) {
       thread = numberOfThreads;
       bag = new bagOfBoards();
       barrier = new CyclicBarrier(thread+1);
       if(thread > 1){
          ExecutorService threadExecutor = Executors.newFixedThreadPool( thread );
          solution = new ThreadTest[thread];
          bag = new bagOfBoards();
          for(int i = 0;i<thread;i++){
             solution[i] = new ThreadTest(bag, lock, barrier, i);
             threadExecutor.execute(solution);
    finally this is the code which is used to acces the bag and get a board.
    synchronized public Board get() {
                if (size > 0) {
                size--;
                Board result = bag[size];
                return result;
            } else {
             return null;
        }since this method is synchronized and it always returns something (either null or a board) and the worker tests for this. there is no race condition here.
    furter more. the main thread is a loop. It fills te bags with an intial state. then it trips the barrier and waits for the workers to do the work. the workers then process the bag until it hits zero and then trip the barrier so that the main thread can do the next iteration (and fill the bag)
    p.s. i know the code is a bit messy, but i want to get the threading to work. As of now i relaly don't understand why the threads are just running on 1 processor instead of 2 processors. not only that. the excecution time is nearly the same as that of a sequential equivalent.
    p.s.2 the code is parallisable. and it is run on a smp system.
    Message was edited by:
    jstrike

    i'm very sure that the jvm and os support smp. the
    problem really should be in the code.I don't see how this can be the case. There's nothing in the Java language that deals with how threads are assigned to processors (at least not as far as I know) so there isn't anything you can do in your code to affect that.
    Or did you meant that i have to tell the jvm in the class that
    there is support for multiple processorsThat would be the only possibility. I have no idea whether it can be done or not, though.

  • CUPS queues don't work with Wide Area Bonjour

    I'm completely flummoxed!
    My school board is installing new switches in all our schools, and moving from a single flat VLAN to multiple - one for printers, one for server, one for client workstations. Printing queues advertised with Bonjour worked fine on the old network, but multiple VLANs breaks all that since Bonjour is in the unrouteable multicast range (which makes sense, since it's not meant to work outside of the local network). I have old Tiger servers at the schools, running on hardware that doesn't do VLANs (old G4 towers), so advertising queues with Bonjour using the school server can't get me by.
    I've set up BIND (DNS) to show my CUPS IPP print queues from a central Lion workstation (elemprtsrv01.example.com) in the school's subnet (10.159.40.0/22; academic-wrd.scd.example.com) as follows (my domain substituted with example.com for anonymity) - the relevant section snipped from the rest of the zone file:
    $ORIGIN academic-wrd.scd.example.com.
    ; Wide Area Bonjour Browsing
    b._dns-sd._udp                    IN PTR          @
    lb._dns-sd._udp                    IN PTR          @
    db._dns-sd._udp                    IN PTR          @
    ; Wide Area Bonjour Printing
    SCD-234-Q._printer._tcp          IN          SRV          0          0  631          elemprtsrv01.example.com.
    _printer._tcp                                         IN PTR          SCD-234-Q._printer._tcp
    _cups._sub._ipp._tcp                     IN PTR          SCD-234-Q._printer._tcp
    _ipp._tcp                                                   IN PTR          SCD-234-Q._printer._tcp
    _universal._sub._ipp._tcp           IN PTR          SCD-234-Q._printer._tcp
    SCD-234-Q._printer._tcp          IN TXT ( "txtvers=1" "qtotal=1" "rp=printers/SCD234Q" "note=2nd Floor Workroom" "ty=Xerox WorkCentre 5755, EXAMPLE Student 2.2" "product=(EXAMPLE-22STUD-XeroxWC5775)" "printer-state=3" "printer-type=0x80B0F6" "Transparent=T" "Binary=T" "Fax=F" "Punch=T" "Bind=F" "Sort=T" "Scan=F" "Duplex=T" "Staple=T" "Copies=T" "Collate=T" "Color=F" "pdl=application/pdf,application/postscript,application/octet-stream,image/jpeg ,image/png" )
    The relevant section of the /etc/cupsd.conf file on elemprtsrv01 (10.100.1.73) looks like this:
    ServerAlias elemprtsrv01.example.com
    ServerAlias printerserver.academic-wrd.scd.example.com
    MaxLogSize 20m
    MaxCopies 100
    LogLevel debug2
    SystemGroup admin
    SystemGroupAuthKey system.print.admin
    # Allow remote access
    #Port 631
    Listen 10.100.1.73:631
    Listen 127.0.0.1:631
    Browsing On
    BrowseOrder deny,allow
    BrowseRemoteProtocols cups
    BrowseLocalProtocols cups dnssd
    DefaultEncryption Never
    DefaultAuthType Basic
    WebInterface Yes
    BrowseWebIF No
    MaxClients 1000
    RootCertDuration 300
    <Location />
      # Allow remote access...
      Order deny,allow
      Allow all
      AuthType None
    </Location>
    <Location /rss>
      Order deny,allow
      Allow all
    </Location>
    <Location /printers>
      Order deny,allow
      Allow all
      AuthType None
      Encryption Never
    </Location>
    <Location /jobs>
      Order deny,allow
      Allow all
      AuthType None
      Encryption Never
    </Location>
    If I use Bonjour Browser on the print server network and on the school's academic-wrd.scd.example.com subnet, I see identical info to that provided by my DNS records - in other words, Wide Area Bonjour (WAB) appears to be working and providing the necessary details.
    When I try to add a printer on a school workstation, the WAB printer appears...though the PPD ("(EXAMPLE-22STUD-XeroxWC5775)" should match SCD234Q.ppd from the server queue) doesn't get imported from the server and I get a Generic Printer Description instead. When I try to print on the client, I see promising notes about connecting to the print server, but then it always pauses the queue. Here's the relevant section from /etc/cups/ppd/SCD234Q.ppd:
    *Manufacturer: "Xerox"
    *ModelName: "Xerox WorkCentre 5775"
    *ShortNickName: "Xerox WorkCentre 5775"
    *NickName: "Xerox WorkCentre 5755, EXAMPLE Student 2.2"
    *PCFileName: "XRWC5775EXAMPLESTUD22.PPD"
    *Product: "(EXAMPLE-22STUD-XeroxWC5775)"
    *PSVersion: "(3010.106) 3000"
    In the CUPS error log, I get this annoying encryption error, which no else appears to have had, according to the usual search engines:
    d [04/Jan/2012:21:47:41 -0500] cupsdAcceptClient(lis=0x7fc585200470(13)) Clients=0
    D [04/Jan/2012:21:47:41 -0500] cupsdAcceptClient: 20 from 10.159.40.174:631 (IPv4)
    d [04/Jan/2012:21:47:41 -0500] cupsdAddSelect(fd=20, read_cb=0x102d74b81, write_cb=0x0, data=0x7fc584034400)
    d [04/Jan/2012:21:47:41 -0500] cupsdReadClient(con=0x7fc584034400(20)) con->http.error=0 con->http.used=0, con->http.state=0 con->data_encoding=HTTP_ENCODE_LENGTH, con->data_remaining=0, con->file=-1
    d [04/Jan/2012:21:47:41 -0500] cupsdReadClient: Saw first byte 02, auto-negotiating SSL/TLS session...
    d [04/Jan/2012:21:47:41 -0500] encrypt_client(con=0x7fc584034400(20))
    D [04/Jan/2012:21:47:41 -0500] get_cdsa_certificate: Looking for certs for "elemprtsrv01.example.com"...
    E [04/Jan/2012:21:47:51 -0500] Unable to encrypt connection from 10.159.40.174 - unknown error -1=ffffffffffffffff (-1)
    D [04/Jan/2012:21:47:51 -0500] cupsdCloseClient: 20
    D [04/Jan/2012:21:47:51 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"
    d [04/Jan/2012:21:47:51 -0500] cupsdRemoveSelect(fd=20)
    d [04/Jan/2012:21:47:51 -0500] cupsdCheckJobs: 0 active jobs, sleeping=0, reload=0
    OK, so here's the annoying bit: if I manually configure the queue on a Snow Leopard (or higher) client by going into System Preferences, adding an IP printer with IPP protocol (elemprtsrv01.example.com, queue name /printers/SCD234Q) then it works. With Leopard or Tiger, the PPD doesn't load from the server, and the generic PPD is substituted automatically.
    If I manually add "ServerName elemprtsrv01.example.com" to /etc/cups/client.conf on the client machine, then it shows all the server queues and magically works too - even on Leopard and Tiger.
    The problem is that I DON'T want to have all the server queues appearing on every workstation, since it'll cause mahem when the students discover all the queues and print to other schools for kicks. WAB was supposed to solve that for me by advertising only the queues that were meant to be accessed by that subnet (they'd all be there on the server, but only a real techie would know how to access them, since they weren't advertised).
    Why don't the WAB queues work? Why do I get an encryption error with them?
    How do I get the server's PPD to download automatically to the client? (this is especially useful for printers with customized PPDs set up with the proper settings for that printer...and for the Xerox copiers that are using accounting codes present in the server's PPD)
    Any help would be very much appreciated!

    Figured it out...stick with Lion (Client or Server) and use the web interface to add printers and customize the /etc/cups.conf file. If you use either System Preferences or the Print config in Server Admin on earlier versions of Mac OS X Server, you'll bugger up your cups.conf file (top part of which is reproduced here):
    ServerAlias *
    LogLevel debug2
    SystemGroup admin
    SystemGroupAuthKey system.print.admin
    # Allow remote access
    Port 631
    Listen elemprtsrv01.example.com
    Listen /private/var/run/cupsd
    Browsing On
    BrowseOrder allow,deny
    BrowseRemoteProtocols CUPS
    BrowseAddress @LOCAL
    BrowseLocalProtocols CUPS dnssd lpr
    DefaultAuthType Basic
    WebInterface Yes
    <Location />
      # Allow remote access...
      Order allow,deny
      Allow all
    </Location>
    <Location /rss>
      Order allow,deny
      Allow all
    </Location>
    <Location /classes>
      Order allow,deny
      Allow all
    </Location>
    <Location /printers>
      Order allow,deny
      Allow all
    </Location>
    <Location /admin>
    </Location>
    The key is to allow anything as a server name (ServerAlias *) and Allow All for / and /printers (though / by itself should be enough). If you want to listen for LPR (port 515) then I think it needs to be listed in BrowseLocalProtocols - it's not a valid option for BrowseRemoteProtocols.
    On the Wide Area Bonjour front, I created TWO different entries for each printer in my domain, because otherwise the queues would appear and instantly disappear in the Tiger browser - Tiger only shows the LPR queue. The queue name is preceded by "printers/" in the IPP queue, but not with the LPR queue. Here's an example from the top of my BIND student zone file:
    $ORIGIN academic-wrd.scd.example.com.
    ; Wide Area Bonjour Browsing
    b._dns-sd._udp                    IN PTR          @
    lb._dns-sd._udp                    IN PTR          @
    db._dns-sd._udp                    IN PTR          @
    ; Wide Area Bonjour Printing
    SCD-234\0322nd\032Floor\032Copier\032LPR\032Q._printer._tcp          IN          SRV          0          0  515          elemprtsrv01.example.com.
    _printer._tcp                                         IN PTR          SCD-234\0322nd\032Floor\032Copier\032LPR\032Q._printer._tcp
    SCD-234\0322nd\032Floor\032Copier\032LPR\032Q._printer._tcp          IN TXT ( "txtvers=1" "qtotal=1" "rp=SCD234Q" "note=2nd Floor Workroom" "Transparent=T" "Binary=T" "Fax=F" "Punch=3" "Bind=F" "Sort=T" "Scan=F" "Duplex=T" "Staple=T" "Copies=T" "Collate=T" "Color=F" "pdl=application/postscript" )
    SCD-234\0322nd\032Floor\032Copier\032IPP\032Q._ipp._tcp          IN          SRV          0          0  631          elemprtsrv01.example.com.
    _ipp._tcp                                                   IN PTR          SCD-234\0322nd\032Floor\032Copier\032IPP\032Q._ipp._tcp
    _cups._sub._ipp._tcp                     IN PTR          SCD-234\0322nd\032Floor\032Copier\032IPP\032Q._ipp._tcp
    _universal._sub._ipp._tcp           IN PTR          SCD-234\0322nd\032Floor\032Copier\032IPP\032Q._ipp._tcp
    SCD-234\0322nd\032Floor\032Copier\032IPP\032Q._ipp._tcp          IN TXT ( "txtvers=1" "qtotal=1" "rp=printers/SCD234Q" "note=2nd Floor Workroom" "ty=Xerox WorkCentre 5755 Student 2.2" "product=(Xerox WorkCentre 5775 Student22)" "printer-state=3" "printer-type=0x80B0F6" "Transparent=T" "Binary=T" "Fax=F" "Punch=3" "Bind=F" "Sort=T" "Scan=F" "Duplex=T" "Staple=T" "Copies=T" "Collate=T" "Color=F" "pdl=application/pdf,application/postscript,application/octet-stream,image/jpeg ,image/png" "URF=W8,SRGB24,CP1,RS600" )
    ;SCD-236\032Office\032LPR\032Q._printer._tcp          IN          SRV          0          0  515          elemprtsrv01.example.com.
    ;_printer._tcp                                         IN PTR          SCD-236\032Office\032LPR\032Q._printer._tcp
    ;SCD-236\032Office\032LPR\032Q._printer._tcp          IN TXT ( "txtvers=1" "qtotal=1" "rp=SCD236Q" "note=Main Office" "Transparent=F" "Binary=F" "Fax=F" "Punch=0" "Bind=F" "Sort=F" "Scan=F" "Duplex=F" "Staple=F" "Copies=T" "Collate=T" "Color=F" "pdl=application/postscript" )
    ;SCD-236\032Office\032IPP\032Q._ipp._tcp          IN          SRV          0          0  631          elemprtsrv01.example.com.
    ;_ipp._tcp                                                   IN PTR          SCD-236\032Office\032IPP\032Q._ipp._tcp
    ;_cups._sub._ipp._tcp                     IN PTR          SCD-236\032Office\032IPP\032Q._ipp._tcp
    ;_universal._sub._ipp._tcp           IN PTR          SCD-236\032Office\032IPP\032Q._ipp._tcp
    ;SCD-236\032Office\032IPP\032Q._ipp._tcp          IN TXT ( "txtvers=1" "qtotal=1" "rp=printers/SCD236Q" "note=Main Office" "ty=Lexmark T520" "product=(Lexmark T520 SCD)" "printer-state=3" "printer-type=0x8090C6" "Transparent=F" "Binary=F" "Fax=F" "Punch=0" "Bind=F" "Sort=F" "Scan=F" "Duplex=F" "Staple=F" "Copies=T" "Collate=T" "Color=F" "pdl=application/pdf,application/postscript,application/octet-stream,image/jpeg ,image/png" "URF=W8,SRGB24,CP1,RS600" )
    Note that the second queue is commented-out in the student zone file because it's the office queue and I didn't want it to appear in student workstation queue browsers. I customized the PPDs for these printers and thus changed the "product=" part of the TXT record to match the name in the altered PPD's "*PRODUCT:" line so that it wouldn't match with an already-installed PPD.
    The above zone file generates two different queues (IPP and LPR) for each printer on Leopard and higher queue browsers, but only one queue (LPR) on Tiger. We're still supporting Tiger and even the odd Mac OS 9 client (no browsing, but they can do a manual LPR queue). Windows does both or you can manually add the IPP queue (add a new network printer using the URL "http://elemprtsrv01.example.com:631/printers/SCD234Q" and make sure you're using the PostScript driver for the printer, or you'll get garbage). iOS devices browse for _universal._sub._ipp._tcp records and you need to add the URF= field in the TXT record or the queue won't show up...and add a file /usr/share/cups/mime/airprint.types with the single line "image/urf urf (0,UNIRAST<00>)".
    All my users from Mac OS 9 to Mac OS X to Windows can now print using a central print server that magically shows up in the print browser...yay!

  • Terminating Event to Event Queue due to Work Item Lock

    I have a dialog workflow task based on an asynchronous method defined with a terminating event.  When the user executes the work item, the method generates the terminating event (via a V2 change document) but the work item is enqueued (locked) by the same user (locked when they execute the work item from SBWP) and therefore the terminating event goes into error and is placed in the event queue.  The background job which processes the event queue does not redeliver the event so it stays in the event queue and the work item fails to complete.  Other than dequeing the work item lock myself with a function call how do I get around this catch 22?

    Hello Martin,
    Actually, the locking happens whether I have the task as asynchronous or synchronous.  The problem is the timing. If the user does not release the lock (by backing out of the dialog which is executed) prior to the terminating event attempting to enqueue and complete the work item then the event goes into error and is inserted into the event queue (and lingers there indefinitely, almost). Another issue with the asynchronous approach is that even if the user backs out of the dialog before the event actually attempts to complete the work item they will still see the work item in the inbox unless they click the refresh button when they get back to the inbox. 
    I have changed the task to synchronous but here is my scenario and another question.
    The process being workflowed is the approval of service entrysheets (similar to an invoice if you are not familiar with External Services).  In our process, there are a large number of documents being created and requiring approval by particular approvers.  It is a normal scenario for an approver to have, lets say 25 documents in his inbox awaiting approval. It was not practical for him to have to navigate back and forth between his inbox and the approval task screen.  Therefore, I give the users the option of (when executing a work item) having all the documents in his in-box (for this particular task) be presented in an approval list screen.  They can then do a mass approval of the 25 documents with 1 click and 1 navigation.  This list screen is also available to be executed outside workflow via a tcode.  So, when the user executes the mass approval (either from the inbox or outside workflow) the work items are terminated via the terminating event assigned to the approval task.
    A couple of issues remaining:
    1) Given my example of 25 work items (user executes 1 work item from in-box
    and I displayed all 25) being approved, when the user returns to the in-box, the 24
    items remain in his inbox until he clicks the refresh button since these were not actually "executed" from the workflow engines point of view.  However, these were terminated successfully because they were not "locked".
    <b>Question:</b> Is there a way (user exit?) to trigger the inbox refresh automatically.
    2) Now, the issue with the actual work item which the user executes from the inbox.  As I mentioned, the work item is locked as soon as the user executes it and is not released until they back out of the dialog or logoff.  So, here is what happens:  If the terminating event is sent before the lock is released the event is sent to the event queue.  If they then back out back to the in-box, its OK since I put some code in the SWO1 object type program (rememeber, its now synchronous) which will determine if they did the approval/rejection and the work item will complete and the event in the event queue will be deleted the next time the Event Queue Background job runs (it deletes any events for work items already in COMPLETED status). However, lets say they simply log off rather than backing up to the in-box or they don't do anything and are eventually logged off by timeout. In this case the code in the object type program to determine if the approval/rejection was done does not get executed (control does not return to the object type program) and the work item remains in "STARTED" status and remains in the users inbox and the event is in the event queue. So, now we have a work item that should be completed still sitting in the users in-box and the terminating event in the event queue. So the next time the user goes to their inbox the work item is still there.  The interesting thing is that though this may be confusing to the user, if they then attempt to execute the work item, they will get a message: "Work item currently being completed by event" (Message SWF_RUN 644) and the event sitting in the event queue gets redelivered and completes the work item.  To alleviate this problem I was thinking of adding a call to SAP_WAPI_WORKITEM_COMPLETE in the approval list screen after they do the approval but I'm guessing it wont work since it probably will try to enqueue the work item and it will still be locked. 
    Hopefully you haven't nodded off reading this rambling note...
    Thank you,
    Bob

  • My file yet in the queue (30 hours)! queue doesn't work?

    I submited a .doc file to convert to pdf about 30 hours ago and viewing the status appear still in the queue. Could it be that the queue is not working now?

    Is the adapter the genuine Apple product or a copy

  • [JCoAPI] The context with the session id scope type [null] is currently used in thread HTTP Worker

    Hello to all SAP-experts.
    I have an error in SAP CE, and i can see in troubleshooting following information:
    [JCoAPI] The context with the session id [JCo_mMnig6B1YRWfNCWhW0pY0CgFOhzFTAHqyFEA_SAP:P3fshVcB4PLh3CzLBVbpf5lVRxzFTAHqyFEA_SAPyxuggqvaUEsNVbxNQybjvxH0] scope type [null] is currently used in thread HTTP Worker [@1902361406] [0x91].Current thread is HTTP Worker [@1590998042] [0x97].
    invoked at com.sap.conn.jco.rt.Context.checkBusy(Context.java:633)
    invoked at com.sap.conn.jco.rt.Context.getConnection(Context.java:153)
    invoked at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1466)
    invoked at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1437)
    invoked at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:300)
    invoked at com.sap.conn.jco.rt.DefaultRequest.execute(DefaultRequest.java:68)
    invoked at com.sap.tc.cm.arfc2.model.ARFC2GenericModelClassExecutable.executeInternal(ARFC2GenericModelClassExecutable.java:107)
    invoked at com.sap.tc.cm.arfc2.model.ARFC2GenericModelClassExecutable.execute(ARFC2GenericModelClassExecutable.java:68)
    invoked at com.sap.tc.cm.arfc2.gci.ARFC2TypedModelClassExecutable.execute(ARFC2TypedModelClassExecutable.java:54)
    invoked at ru.sng.terminal.utt.terminals.wd.comp.utt_term.Utt_term.loadReasonsToStop(Utt_term.java:1542)
    invoked at ru.sng.terminal.utt.terminals.wd.comp.utt_term.Utt_term.wdDoInit(Utt_term.java:186)
    invoked at ru.sng.terminal.utt.terminals.wd.comp.utt_term.wdp.InternalUtt_term.wdDoInit(InternalUtt_term.java:1054)
    invoked at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:161)
    invoked at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:227)
    invoked at com.sap.tc.webdynpro.progmodel.components.Component.initController(Component.java:258)
    invoked at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:206)
    invoked at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:590)
    invoked at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doPreprocessing(ClientApplication.java:1457)
    invoked at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doPreprocessing(ApplicationSession.java:660)
    invoked at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:349)
    invoked at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:326)
    invoked at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doContent(AbstractDispatcherServlet.java:87)
    invoked at com.sap.tc.webdynpro.serverimpl.wdc.DispatcherServlet.doContent(DispatcherServlet.java:89)
    invoked at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doGet(AbstractDispatcherServlet.java:55)
    invoked at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
    invoked at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    invoked at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
    invoked at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)
    invoked at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:457)
    invoked at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)
    invoked at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)
    invoked at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)
    invoked at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
    invoked at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
    invoked at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
    invoked at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
    invoked at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)
    invoked at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)
    invoked at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)
    invoked at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    invoked at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    invoked at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)
    invoked at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)
    invoked at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
    invoked at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
    invoked at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
    invoked at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
    Please, tell how can i solve this problem ?

    Hi Konstantin,
    it has nothing to do with the number of system threads. You are obviously executing several function modules statefully in multiple threads within the same session context. Stateful requests can only be executed in an ordered manner in case they should belong together. You are using ARFC2, which is part of the WebDynpro runtime. In case you are sure that the calls are independent from each other, it might be a good idea to adjust the scope type of some of your bindings. Then the requests will be executed with different scopes depending on your configuration and you can execute them concurrently
    Best regards,
    Markus

  • Plz can someone show me simple thread code work

    Plz can someone show me simple thread code work with main function, without any applet...thread including start(),run(), and stop(), am I right or not ??
    thx

    http://java.sun.com/docs/books/tutorial/essential/threads/index.html

  • Can someone explain how a Thread actually works

    Can somebody explain to me how a Thread actually works. How can the the run() method be called by the start() method? It doesn´t make sense to me.

    Well, all Java code is just methods calling other methods. I don't see what the confusion is. You create a Thread instance, give it a Runnable, and when you call start() on the thread, it calls run() on that Runnable.

  • Print queue does not work

    Since the update I did from Tiger to Leopard the Print Queue does not work. When I print a document the printer starts to jump up and down on the Dock for more than 5 minutes. Printing finishes and the icon of the printer is still "dancing" on the Dock. If I try to open Print Queue the window does not open immediately but after a long time and I can't see the printing documents that are waiting in the queue. As a result I can't stop or pause or delete a printing document. The same thing happens if I try to open Print Queue from the Print & Fax Preferences' window. The window opens after a long delay and nothing can't be controlled from this window. I forgot to say that the printer icon remains on the Dock and Force Quit is the only option I have when trying to quit it.
    I have tried Permissions Repair. Nothing happened. I installed the latest driver. The problem is still there. Only after Reseting Printing System the problem is fixed but until the first reboot. If I restart the computer then the problem appears again and the only thing I can do is to Reset again the Printing System. So, if I want to control the printing procedure, I have to Reset Printing System after every restart!!! Any help???
    P.S. I have a Canon iP4500 but I don't think that the printer is the problem because with Tiger I had never face this problem and I have also printed with this printer from a MacBook running Leopard with no problems.

    1) I tried Print Therapy and after I had repaired Permissions the problem was solved (some permission problems were found) until the next restart.
    2) Then I tried to stop and start again the cupsd process and again the problem was solved until the next restart of the computer.
    3) Then I replaced the cupsd.conf file with a new one but the app asked to restart the computer and after this the problem was back.
    4) Print Therapy does not find any problems neither in the properties of the root user nor in the current user or any other group.
    5) Also the verification of the temporary files find no problems.
    In conclusion I think that the problem lies in the cupsd process because when stopped and restarted (we can forget that by Repairing Permissions actually we restart cupsd) I have no problem until the next restart of the computer.

  • Running the Thread while working in Foreground

    Hi Friends,
    I m developing an application for that i have to use Threads.
    Currently i m using a single thread for Socket Connection.
    It works fine and the connection establishes successfully. Also it sends &
    receives data well.
    But my problem is that if while establishing connection if it takes more time
    on slow network and if user pressed any key then i want to place a message.
    I m not using Servlets in my application.
    It gives message but after the completion of the Thread's work.
    I want it should happen immediately...after key pressed and Thread must be
    working in background simultaneously.
    If anybody have any idea then plz suggest me.
    I'll be highly grateful to u people.
    Thanking you,
    Ajit

    Hi Samir Pro,
    Check out the Settings menu (Wrench). You can change the playback resolution there. Does that work for you?
    Thanks,
    Kevin

  • Pick queue item to work on, check "Also remove item from queue(s)" - where did it go?

    We recently upgraded from CRM 2011 to 2015.
    When users pick a queue item to work on, and check "Also remove item from Queue" - where does it go?  I cannot find a view that lists these items anywhere???

    Hi This depends on, which entity is in the queue. If it is an opportunity it could be found in opportunities If it is an email it could be found in activities etc. If you upgraded from crm2013, where could you find it before update to crm2015? Hope it
    helps. Gr.peb

  • A thread's "working memory" -- opstack, lva, other?

    Hi,
    In reading section 8.1 of the JVM spec:
    (http://java.sun.com/docs/books/vmspec/2nd-edition/html/Threads.doc.html#22197)
    ... I have these two questions:
    1) I see it refers to a thread's "working memory". What exactly is this? At first I thought it was any information that was located on the thread's operand stack. Then I thought maybe it was the thread's local variable array. Now I'm not sure what to think... is it totally separate from both of these?
    2) This section states that the thread performs the use/assign/load/store/lock/unlock ops, and that that the MMSS (Main Memory SubSystem) performs the read/write/lock/unlock ops. Okay, fine... but then it says later in that section that "A single thread issues a stream of use, assign, lock, and unlock ops..". Okay, so what happened to "load" & "store"? Maybe the term "thread" is supposed to refer only to the execution engine and not this "working mem"? Okay, let's go with that. Then later... "The underlying JVM impl is required to perform appropriate load/store/read/write ops.." Oh really? I thought it just said that the thread and the MMSS perform those? So confused!
    Please help,
    --Will                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    In reading section 8.1 of the JVM spec:
    (http://java.sun.com/docs/books/vmspec/2nd-edition/htm
    l/Threads.doc.html#22197)
    ... I have these two questions:
    1) I see it refers to a thread's "working memory".
    What exactly is this? At first I thought it was any
    information that was located on the thread's operand
    stack. Then I thought maybe it was the thread's
    local variable array. Now I'm not sure what to
    think... is it totally separate from both of these?
    2) This section states that the thread performs
    the use/assign/load/store/lock/unlock ops, and that
    that the MMSS (Main Memory SubSystem) performs the
    read/write/lock/unlock ops. Okay, fine... but then
    it says later in that section that "A single thread
    issues a stream of use, assign, lock, and unlock
    ops..". Okay, so what happened to "load" & "store"?
    Maybe the term "thread" is supposed to refer only to
    the execution engine and not this "working mem"?
    Okay, let's go with that. Then later... "The
    underlying JVM impl is required to perform
    appropriate load/store/read/write ops.." Oh really?
    I thought it just said that the thread and the
    MMSS perform those? So confused!
    Please help,
    --Will1. The thread's operand stack is not the same as the working memory of the thread. The term "working memory" is deliberately abstract since where it is located is dependent on the vm implementation (registers, cache etc can all make up the "working memory")
    2. The thread can perform load and store operations, but in the specific case you describe the underlying vm implementation performs those operations to obey a certain set of constraints defined later in that section.

  • Try to queue threads of clients but there is something wrong!

    Hello. I have been trying to queue threads of clients in multithreaded server but there is a problem none of the threads is alive.
    here is my code.
    class queueClient extends Thread{
    HandleServer sa1;
    LinkedList queue = new LinkedList();
    queueClient(){
    super();
    }//end of costructor
    /**method in the queueClient class to put each client in the queue*/
    public void queuethem(HandleServer s){
    try{
    s.wait();
    queue.add(s);
    catch(InterruptedException sleep){
    System.exit(0);
    }//end of queuethem
    /**method in the queueClient class to manage the clients in the queue*/
    public void manageQueue(HandleServer sa){
    if(!queue.isEmpty() && (queue.size())==1){
    sa= (HandleServer)queue.removeFirst();
    sa.notify();
    sa.start();
    else if (!queue.isEmpty() && (queue.size()>1)){
    sa= (HandleServer)queue.removeFirst();
    sa.notify();
    sa.start();
    try {
    if(sa.currentThread().isAlive()){
    sa1= (HandleServer)queue.removeFirst();
    sa1.join();
    else{
    sa1.notify();
    sa1.start();
    catch (InterruptedException join) {
    System.exit(0);
    else{
    System.out.println("Queue is empty");
    }//end manageQueue
    }//queueClient class end

    ok lets say that i have 3 clients connected to my server which is responsible to pass the messages from only one client to a robot.
    Ok ?
    Then this server must queue the other two clients and leave only one "Alive" and the other two must wait a certain amount of time untill the current client that speaks with the server and the robot to die and then to wake up the other one client and start to talk with the server and the robot
    now is it more clear?

  • Tuning the good number of thread with Work Manager?

    Hi,
    I search some best practice or experience return on the max thread number on a weblogic managed server
    I try to explain: with WLS 8.1 and execute queue it was hard to tune the good number of thread but possible (with some processor and for an application we find that after 30 concurrent thread, there's lower performance because of switch on processeur, for others it was 45 for example)
    Now i can see sometimes more than 500 thread on one JVM and it seem to be very much for me!!
    we face some problem of response time in PRODUCTION, i can see sometimes more than 100 Stuck thread on a resource, so i think it's the reason of bad response time. But with Work Manager, it increase the number of thread to accept others request and the CPU stay at acceptable level (less than 50%) because the stuckthread are do nothing (waiting for resource)
    So i don't understand the good tuning to apply since WorkManager...ok it isn't normal to have a lot of stuck thread but if there's no matter about the max number of thread, is it useful to stop and restart managed server?
    do you think we can have have bad performance if there's a lot of thread?
    thank you for your experience return. If you have no idea just tell me how much thread you can see on your managed server in Production.

    up, up...
    we have always the same probleme in production: 50 stuck thread on each JVM since 15 days....
    the manages serveurs are in warning but don't seem to be disturb cause the work manager add more threads dynamicaly.
    Anyone have idea if this situation is a probleme for response time on other request ?
    reboot managed solve this situation but i would like to understand the consequence of this situation.
    thanks a lot for your experience.

Maybe you are looking for

  • V$BGPROCESS and V$SESSION

    This is on 10g. V$BGPROCESS displays information about background processes V$SESSION has some rows representing background processes. What is the difference between two ? Am I correct in understanding that ; v$bgprocess contains total allocated proc

  • Queue Stucked - Exactly Once Async Abap Proxy

    Hi Guys I have several JMS->Xi->Abap Proxy scenarios in my production environment, the Abap Proxies servers are in a SAP IS-OIL 4.72 with a SAP WEBAS 6.20 and the XI is the XI 3.0. Some of the Abap Proxies calls are asynchronous, and when one of the

  • How can i change the request description?

    how can i change the request description? in BI 7 Regards Kiran

  • Stopping a payment

    How do I go about stopping a payment on my account

  • Throttling in OSB

    Hi, We are looking for Throttling in OSB, where in an OSB service should process only x requests at any given point of time. Work Manager maximum thread constraint is one way we found which enables throttling and can limit the number of threads proce