Starting threads in background?

I am trying to address the issue where I have a somewhat
          time-consuming server-side operation, and I don't want the
          browser to time out, etc. So, I want to use a the html
          meta-refresh capability to keep the browser happy,
          and possibly send it some percent completed status info, etc.
          But to do this, it seems like I need to be able to start another
          thread on the server which will do the work, which the
          session thread can monitor, etc.
          Is there a certain way within weblogic that threads should be
          created etc., or is it allowed at all. I know that it is not
          allowed to start new threads within EJB code. What about
          within JSP's and JavaBeans?
          Thanks,
          Jason
          

You can just redirect using the response object, however sometimes you may
          want to do some fancier stuff with JavaScript, that is all I meant.
          > I am not clear on how you are able to detect when "processing..."
          > is completed. Do you use a meta refresh to spin until the
          > processing is done on the server side, and then redirect?
          Basically, yes. There are really two things to do:
          1) Displaying status of processing (not started, in progress, done)
          2) Refreshing if not done
          For example, if you identify the task as 1752324, your URL might be:
          http://myco.com/myapp/showstatus-1752324.proc
          Or:
          http://myco.com/myapp/showstatus?id=1752324
          The point is that the same URL could show:
          "Has not started yet"
          Then:
          "Is in phase 1"
          Then:
          "Is in phase 2"
          Then:
          "Is finished"
          And if the user refreshes the page in the browser or saves off the URL and
          visits it later or whatever, the process itself will not be repeated, just
          the status will be displayed
          Cameron Purdy
          [email protected]
          http://www.tangosol.com
          WebLogic Consulting Available
          "Jason Rosenberg" <[email protected]> wrote in message
          news:[email protected]...
          > Cameron,
          >
          > It seems like your response below is something you like to cut and
          > paste and post repeatedly...But can you augment it a little to explain
          > the second part of step 3, the "uses javascript to redirect" part?
          >
          > I am not clear on how you are able to detect when "processing..."
          > is completed. Do you use a meta refresh to spin until the
          > processing is done on the server side, and then redirect?
          >
          > Or what?
          >
          > I am not that familiar yet with JavaScript, does it have built in
          > functionality to do this? I am guessing not, since it is entirely
          > client-side....
          >
          > Jason
          >
          >
          > "Cameron Purdy" <[email protected]> wrote in message
          > news:[email protected]...
          > > 1) The work to be done is assigned a uid or something similar to
          prevent
          > it
          > > from being done twice
          > > 2) The user presses the button which passes the uid in a hidden field
          > (for
          > > example)
          > > 3) The serlvet responds by kicking off the big process with jms and
          sends
          > > back a page that displays a "processing..." message and uses javascript
          to
          > > redirect (with a place to click just in case javascript is turned off)
          > > 4) The url redirected to includes the uid to identify the process for
          > which
          > > the result is desired
          > > 5) When the process is completed, the information is placed in some
          known
          > > location (e.g. HttpSession or database) and the pending request to find
          > the
          > > result can return the result
          > >
          > > --
          > >
          > > Cameron Purdy
          > > [email protected]
          > > http://www.tangosol.com
          > > WebLogic Consulting Available
          > >
          > >
          > > "Jason Rosenberg" <[email protected]> wrote in message
          > > news:[email protected]...
          > > > I am trying to address the issue where I have a somewhat
          > > > time-consuming server-side operation, and I don't want the
          > > > browser to time out, etc. So, I want to use a the html
          > > > meta-refresh capability to keep the browser happy,
          > > > and possibly send it some percent completed status info, etc.
          > > >
          > > > But to do this, it seems like I need to be able to start another
          > > > thread on the server which will do the work, which the
          > > > session thread can monitor, etc.
          > > >
          > > > Is there a certain way within weblogic that threads should be
          > > > created etc., or is it allowed at all. I know that it is not
          > > > allowed to start new threads within EJB code. What about
          > > > within JSP's and JavaBeans?
          > > >
          > > > Thanks,
          > > >
          > > > Jason
          > > >
          > > >
          > >
          > >
          >
          >
          

Similar Messages

  • Error while starting WebLogic at background

    Hi, All!
    I try to start WebLogic at background mode:
    nohup ./startWebLogic.sh 2&>1 &
    but got this error:
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=192m
    WLS Start Mode=Development
    CLASSPATH=/home/user1/Oracle/Middleware2/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/user1/Oracle/Middleware2/patch_wlp1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/user1/Oracle/Middleware2/patch_oepe1111/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/user1/Oracle/Middleware2/jdk160_14_R27.6.5-32/lib/tools.jar:/home/user1/Oracle/Middleware2/utils/config/10.3/config-launch.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/weblogic_sp.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/weblogic.jar:/home/user1/Oracle/Middleware2/modules/features/weblogic.server.modules_10.3.2.0.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/webservices.jar:/home/user1/Oracle/Middleware2/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/home/user1/Oracle/Middleware2/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/xqrl.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/xquery.jar:/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/binxml.jar
    PATH=/home/user1/Oracle/Middleware2/wlserver_10.3/server/bin:/home/user1/Oracle/Middleware2/modules/org.apache.ant_1.7.0/bin:/home/user1/Oracle/Middleware2/jdk160_14_R27.6.5-32/jre/bin:/home/user1/Oracle/Middleware2/jdk160_14_R27.6.5-32/bin:/mnt/weblogic/Java/jdk1.6.0_21/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/user1/bin
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http://hostname:port/console *
    starting weblogic with Java version:
    Listening for transport dt_socket at address: 8453
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
    Starting WLS with line:
    /home/user1/Oracle/Middleware2/jdk160_14_R27.6.5-32/bin/java -client -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=192m -Dweblogic.Name=AdminServer -Djava.security.policy=/home/user1/Oracle/Middleware2/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=/home/user1/Oracle/Middleware2/wlserver_10.3 -Dwls.home=/home/user1/Oracle/Middleware2/wlserver_10.3/server -Dweblogic.home=/home/user1/Oracle/Middleware2/wlserver_10.3/server -Dweblogic.wsee.bind.suppressDeployErrorMessage=true -Dweblogic.wsee.skip.async.response=true -Dweblogic.management.discover=true -Dwlw.iterativeDev=true -Dwlw.testConsole=true -Dwlw.logErrorsToConsole=true -Dweblogic.ext.dirs=/home/user1/Oracle/Middleware2/patch_wls1032/profiles/default/sysext_manifest_classpath:/home/user1/Oracle/Middleware2/patch_wlp1032/profiles/default/sysext_manifest_classpath:/home/user1/Oracle/Middleware2/patch_oepe1111/profiles/default/sysext_manifest_classpath:/home/user1/Oracle/Middleware2/wlportal_10.3/p13n/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/light-portal/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/portal/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/info-mgmt/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/analytics/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/apps/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/info-mgmt/deprecated/lib/system:/home/user1/Oracle/Middleware2/wlportal_10.3/content-mgmt/lib/system -Dweblogic.alternateTypesDirectory=/home/user1/Oracle/Middleware2/wlportal_10.3/portal/lib/security 2 weblogic.Server
    Listening for transport dt_socket at address: 8453
    Exception in thread "main" java.lang.NoClassDefFoundError: 2
    Caused by: java.lang.ClassNotFoundException: 2
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: 2. Program will exit.
    When I start WebLogic as usualy (./startWebLogic.sh) - it starts normally
    I think problem may be with Classpath, but I don't know
    Thank in advice :)
    Edited by: Grey Goose on 24.09.2010 1:11

    Thanks, Girish! I have found parameters
    MEM_PERM_SIZE_64BIT="-XX:PermSize=192m"
    and
    MEM_MAX_PERM_SIZE_64BIT="-XX:MaxPermSize=192m"
    at setDomainEnv.ch and have changed it to
    MEM_PERM_SIZE_64BIT="-XX:PermSize=256m"
    and
    MEM_MAX_PERM_SIZE_64BIT="-XX:MaxPermSize=256m"
    accordingly :)

  • Disk utility started, but a background process needed in disk utility didn'

    I am stumped. I have talked to tech support, read many threads on this error message, tried all the suggested solutions, and still I get this message "Disk utility started, but a background process needed in disk utility didn't start properly. Please quit and restart disk utility."
    The problem has been around for a while apparently. One technique called for removing iTunes to the desktop, trashing certain files in the library, then running disk utility. This did not work. Another suggestion was to trash, of all thing, the Chess program. This also did not work. Booting from the installation disk and running disk utility there to repair permissions also apparently does not work. Nor do third party software, such as YASU seem to get through to repair permissions.
    Given the number of discussion boards addressing this problem, i was stunned that applecare/tech support person I talked to had never heard of it. Please please please help!

    If you moved Disk Utility from the /Applications/Utilities directory, i.e. the Macintosh HD > Applications > Utilities folder, move it back to that folder.
    If memory serves, the "workaround" you cited involving iTunes only applies if you are using Mac OS X 10.3.9.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Start rmiregistry in background

    I am using windows NT. I'ld like to start rmiregistry in background.
    I already tried to write in a bat file :
    - "start rmiregistry" but it open a new command window which stay in foreground
    - "start /b rmiregistry". It doesn't open a news window but the main command window doesn't disappear
    I would like to launch a bat file which start only the "rmiregistry.exe". I would like to see the rmiregistry only in the task manager and not in a command window on the task bar. That is what i mean with "background". The rmiregistry must be hidden to a common windows user.

    However, if there is not another solution, do you
    know if running the rmiregistry in java code is
    slower than running the .exe file ?That I cannot say for sure, but I don't think it would make any big difference.
    That can be a good idea. Do you know how I can do
    that on NT and XP?I must admit that I am inexperienced starting .exe-files as service. I do know though how to start a java-application as a service:
    http://wrapper.tanukisoftware.org/doc/english/introduction.html
    If you use the software above, wrap this class and the rmiregistry should be launched as a service:
    public RMIRegistryStarter {
           public static void main(String[] args) {
                    int port = 1099;
                    if (args.length > 0) {
                          try {
                              port = Integer.parseInt(args[0]);
                          } catch(Exception ex) {}
                    LocateRegistry.createRegistry(port);
                    while(true) {
                         Thread.sleep(1000);
    And can a bat file start this service?Of course:
    net start my_rmi_service_name

  • MaterialMaster_CreateIDOC Cannot start thread

    I am using the Material_Master AOI template with data services I wanted to loop through the IDOC for each plant starting with our main plant then as we loop material would be pushed (extended) to the other plants. When I looped the second time I go the error below. It appears because the connection is already opened for the IDOC another cannot thread be created. Can I close the connection when each plant is pushed and then re-open for the next plant?
    7036       7160       SYS-050703         9/20/2011 2:47:24 PM    |Session Job_P2CMM01_Res_Material_Master|Work flow WF_P2CMM01_Res_MaterialMaster_GenerateIDOC|Data flow DF_P2CMM01_Res_MaterialMaster_CreateIDOC
    7036       7160       SYS-050703         9/20/2011 2:47:24 PM    Cannot start thread.

    Tasks are meant to be run in the context of a JavaFX application, like in the example below:
    import javafx.application.Application;
    import javafx.concurrent.Task;
    import javafx.scene.Scene;
    import javafx.scene.layout.StackPane;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import java.io.IOException;
    public class TaskApp extends Application {
      public static void main(String[] args) { launch(args); }
      @Override public void start(final Stage stage) throws IOException {
        //create task object
        Task<Integer> task = new Task<Integer>(){
          @Override
          protected Integer call() throws Exception{
            System.out.println("Background task started...");
            int iterations;
            for(iterations = 0; iterations < 10000; iterations++){
              if(isCancelled()){
                break;
              System.out.println("Iteration " + iterations);
              Thread.sleep(3000);
            return iterations;
        //start the background task
        Thread th = new Thread(task);
        th.setDaemon(true);
        System.out.println("Starting background task...");
        th.start();
        stage.setScene(new Scene(new StackPane(), 200, 100, Color.BLANCHEDALMOND));
        stage.show();
    }Also your code was setting the task thread as a daemon thread. The Java Virtual Machine exits when the only threads running are all daemon threads. So once your main routine finished (which would be really quickly), the program would just exit without doing anything much. Note that, in your example, even if you made the Task thread a non-daemon thread, it still doesn't work (likely because the Task class has some reliance on the JavaFX system being initialized). For your simple background process you could skip Task and just use a Runnable or a Callable (which doesn't require JavaFX and hence would work in a non-daemon thread invoked from main), but I guess it's just an experiment.

  • Start Thread method behaviour

    I'm using Oracle 10
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining optionsI created two Java classes and a wrapper procedure.
    1. The first class timeOutSAPEntry has a delay caused by sleep method of 10 sec. then updates a row in table sap_entry.
    2. The second class createMonitorSAPEntry creates an instance of timeOutSAPEntry, call start() method and ends.
    3. And the wrapper procedure just calls createMonitorSAPEntry.
    My problem: when I call the wrapper procedure, it hangs for 10 sec (consequence of sleep method). But, I expected that the thread could be created, started and then the control returns to procedure and finishes immediatelly. You can see in the execution below the sysdate before and after the procedure call.
    Is there any solution? I would like the same behaviour of others JVM, where the main thread continues the execution and not hangs out waiting for the started thread.
    create or replace
           and compile java source named "timeOutSAPEntry"
    as
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    public class timeOutSAPEntry
        extends Thread{
        public void run(){
            try{
                 this.sleep(10000);
                 Connection conn =
                        DriverManager.getConnection("jdbc:default:connection:");
                 PreparedStatement  st = conn.prepareStatement("update cmforna.sap_entry set status = 'Failed' where Status = 'Sent'");
                 st.executeUpdate();
                 st.close();
                 conn.commit();
                 conn.close();      
            }catch(Exception e){
                e.printStackTrace();
    create or replace
           and compile java source named "createMonitorSAPEntry"
    as
    public class createMonitorSAPEntry{
       public static void create(){
            timeOutSAPEntry to = new timeOutSAPEntry();
            to.start();
    create or replace procedure create_monitor_post
    as
    language java name 'createMonitorSAPEntry.create()';
    SQL> insert into sap_entry
      2  (id, posted_on, status)
      3  values
      4  (6, sysdate, 'Sent');
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select to_char(sysdate, 'hh24:mi:ss') Before_Time from dual;
    BEFORE_T
    16:27:04
    SQL>
    SQL> exec create_monitor_post;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select to_char(sysdate, 'hh24:mi:ss') After_Time from dual;
    AFTER_TI
    16:27:14
    SQL> Many tks,
    Miguel

    Add a KeyAdapter like this:
    addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent ke) {
        int key = ke.getKeyCode();
        if (key == KeyEvent.VK_LEFT) x1--;
        if (key == KeyEvent.VK_RIGHT) x1++;
    });*Note that I added this just after the bouncing = true; ... which is on about line 33.
    **Note that you will need to click in the Applet before the keys will function.
    ***Note that you will also likely want to slow down the balls.
    ~Bill

  • Transaction Launcher starts popup in Background

    Hi,
    i´m using the transaction launcher to start a external URL in the CRM WebUI.
    I selected to option "Statefull" which means the transaction launcher opens a popup.
    That works fine so far.
    But the popup always starts in the background.
    Which means i have a new IE-window with my launch transaction but not directly available. It starts in the background and my SAP CRM WebUI stays in the visible session.
    Does anybody know how to change this?
    My IE version is IE6.0 SP2.
    thank you
    Best regards
    Manfred

    Hy Brian,
    thank you.
    This note seems to be the right one for this issue.
    But the note is not available for CRM 7.0.
    I opened a message for this and i hope that the note will be available for CRM 7.0 soon.
    Best regards
    Manfred

  • How to run threads in background

    hi everyone!
    I need some hints on my problem!
    I have an application with some working threads. When the user minimizes the app the app should go to the system tray and the threads should keep working.
    I already know how to put an icon with popup menu in the systray. Now, how can I run the working threads in background?
    Can anybody help me?
    C u,
    Filipe

    I said that because as far I understood the following code it just creates an icon and popup menu, right?
    So, when the user minimizes the app I need to kill it, create the icon and popup menu and leave the threads working.
    public class SystemTrayDemo extends JFrame
         private static final long serialVersionUID = 1L;
         public SystemTrayDemo()
              JPopupMenu menu = new JPopupMenu("Menu");
              JMenuItem menuItem1 = new JMenuItem("Menu1");
              JMenuItem menuItem2 = new JMenuItem("Menu2");
              JMenuItem menuItem3 = new JMenuItem("Menu3");
              JMenuItem menuItem4 = new JMenuItem("Exit");
              menu.add(menuItem1);
              menu.add(menuItem2);
              menu.add(menuItem3);
              menu.add(menuItem4);
              menuItem4.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        System.exit(0);
              ImageIcon icon = new ImageIcon("database.png");
              TrayIcon trayIcon = new TrayIcon(icon, "Hello System Tray", menu);
              SystemTray tray = SystemTray.getDefaultSystemTray();
              tray.addTrayIcon(trayIcon);
         public static void main(String[] args)
              try
                   javax.swing.UIManager.setLookAndFeel("com.sun.java.swing. plaf.windows.WindowsLookAndFeel");
              catch(Exception e)
                   System.out.println(e);
              new SystemTrayDemo();
    }}

  • Error starting thread: Not enough storage is available to process...

    Hi all,
    We are seeing server going down frequently with below exception:
    [ERROR][thread ] Failed to start new thread
    [2010-04-08 14:36:54,046][ERROR][com.astrazeneca.portal.rss.ContentTransformer] - Error processing item:null
    ; SystemID: http://beaa.astrazeneca.net:10002/NewsBroker/resources/newsToRss.xsl; Line#: 21; Column#: 128
    javax.xml.transform.TransformerException: java.lang.Error: Error starting thread: Not enough storage is available to process this command.
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:403)
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:426)
         at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)
         at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:437)
         at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:199)
         at org.apache.xpath.XPath.execute(XPath.java:268)
         at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:279)
         at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:247)
    I have a weblogic support SR open and they suggested to add -XXtlaSize and -XXlargeObjectLimit to our JVM parameter. With these parameters, we are getting below error in Windows frequently:
    Reporting queued error: faulting application java.exe, version 1.5.0.11, faulting module jvm.dll, version 27.3.1.1, fault address 0x0014b442.
    I have seen few threads on Sun forum, but answer was not posted there. Details of our environment are as below:-
    JVM : JROCKIT 1.5.0.11
    OS : Windows 2003
    Application Server : Weblogic 10
    Any inputs or pointers will be highly appreciated as this is a bit urgent for me...
    Thanks & Regards,
    Sanjeev

    Hi Henrik,
    I am running Weblogic with below parameters now:
    -Xnohup -Xms:1536m -Xmx:1536m -XXtlaSize:min=32k,preferred=768k -XXlargeObjectLimit:32K
    Weblogic crashed again with below dump:
    ===== BEGIN DUMP =============================================================
    JRockit dump produced after 0 days, 07:17:18 on Fri May 07 15:26:16 2010
    Additional information is available in:
    E:\PortalLIVDomaina\jrockit.5772.dump
    E:\PortalLIVDomaina\jrockit.5772.mdmp
    If you see this dump, please open a support case with BEA and
    supply as much information as you can on your system setup and
    the program you were running. You can also search for solutions
    to your problem at http://forums.bea.com in
    the forum jrockit.developer.interest.general.
    Error Message: Illegal memory access. [54]
    Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x005148AF - memory at 0x00000000 could not be written.
    Minidump : Wrote mdmp. Size is 1406MB
    SafeDllMode : -1
    Version : BEA JRockit(R) R27.3.1-1_CR344434-89345-1.5.0_11-20070925-1628-windows-ia32
    GC Strategy : Mode: throughput. Currently using strategy: genparpar
    GC Status : OC currently running, in phase: sweeping. This is OC#3000.
    : YC is not running. Last finished YC was YC#9937.
    OC History : Strategy genparpar was used for OC#1.
    : Strategy singleparpar was used for OC#2.
    : Strategy genparpar was used for OC#3 to OC#3000.
    YC History : Ran 11 YCs before OC#2996.
    : Ran 18 YCs before OC#2997.
    : Ran 11 YCs before OC#2998.
    : Ran 8 YCs before OC#2999.
    : Ran 1 YCs before OC#3000.
    Heap : 0x00900000 - 0x60900000
    Compaction : 0x06900000 - 0x0C900000
    Could you please provide some input on this?
    Thanks,
    Sanjeev

  • HOW DO I START THREADS ALL AT ONCE? please help!

    HI! I was just wondering if anybody knew how to start threads all at once. There is the treadgroup stuff but the only method I see there is threadgroup.resume I would like something analogous to threadgroup.start
    any ideas?
    thanks,
    - cunduro

    I don't think you can start all threads at the same time. If what you need is to have all threads ready before they begin doing their job, in the run method you can call a method that waits on some object and when all threads are created (and running and waiting on the object) do a notifyAll(). In that moment all threads will resume working.

  • Starting threads

    Hello all.
    I'd like to ask a simple question regarding new threads creation.
    I need to create a service that opens a new ServerSocket and keeps listening to it. When a new connection arrives, it should use a separated thread to handle the incoming connection. Quite like a HTTP Server.
    I've read that you can't start new threads in the EJB container; so I got confused: where can I start threads? Or how? Can you please explain? Please, I need help with this and can use any pointer of where to look for an answer.
    Thanks a lot.
    Leo.

    I believe you can set an option for oc4j to enable threads I think the option is -useThreads. You can then launch your socketserver from a servlet if you want.
    Not sure if this is good practice or not, but I have heard of people doing it.

  • Firefox will run reasonably fast - for a while, I do have quite a few tabs open, They start out in background mode, but as soon as I access them it slows

    My problem is Firefox will run reasonably fast - for a while, I do have quite a few tabs open, They start out in background mode, but as soon as I access them (to view or download from them) even if I close them as I go, FF will start to slow down and it isnt long before FF drops to a crawl sometimes taking MINUTES to answer a click on the file menu (example) no fancy benchmarks needed.
    Having to restart FF and hoping your tabs come back for a temp. speedboost is NOT acceptable.
    I have to restart at least 3-5x a day - anyone else think this is stupid?
    I have 6 gigs ram, XP 32 only uses about 3.5 of it, 2.33ghz core duo, plenty of drive space.

    I understand that after using Firefox for a while there are some issues with speed. [[Firefox is slow - How to make it faster]]

  • I stopped importing media so i could delete what i didn't want, how do you re start them in background tasks?

    so i could delete what i didn't want, how do you re start them in background tasks?

    First, I'd recommend you contact iAd support as they may be able to help resolve some of your issues.
    Regarding Blueprints vs. custom, you could start with a Blueprint, fill in every part you care about, ensure there are no validation errors reported by iAd Producer (Inspector sidebar), File > Convert to Normal Project, then delete any unused pages and banners.
    While I haven't used Workbench, in looking at the available ad types documented in the help (http://help.apple.com/iadworkbench/mac/2.0/#slvbb8575343), why not use the "Banner ad that plays a video with iTunes Store or App Store call to action" or "Banner ad that goes to iTunes Store or App Store product page"?

  • Change infopackage scheduling rom Start later in background to immediate

    Hi all,
    I am having the following issue,
    How to make permanent changes to Infopackage which are included in process
    My Infopackage is containing the following setting in Schedule Tab
    1. Start later in background (Immediately)
    This infopackage is included in one process chain.
    I am changing the above setting to “Start Data Load Immediately” and saving it, but when I am opening that infopackage again the setting is going back to Start later in background (Immediately) .
    Please let me know how can I change the setting “Start later in background” (Immediately) to “ start Data load Immediately” perfectly .
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/infopackage-load-immediate-691990
    Please suggest.
    Raj.

    Hey Raj,
    Once you save the job as run in background it cannot be saved back to the run immediate. But that doesnt mean that your job aint set to immediate.
    Infact within the scheduling tab itself you will notice many tabs
    namely
    Immediate
    Date/Time
    Afterjob
    afterevent
    at operation mode etc
    Now observe when you have set it as immediate, as soon as you click on the immediate tab Under Date/time you would see a small faded check box with Immediate start checked. This says that the job would start immediately if you are not going to use the other options.
    Bottom line Start date load immediately and start later in background with
    immediate start checkbox faded gives the same effect unless u are having other specifications set.
    If you click on start with either of the options its going to start immediately. So dont worry abt the radio button being activated for background.
    Thanks
    Raj

  • Starting threads in constructors

    Hi,
    This is kind of a general question. I have a class which initializes a thread within a constructor. e.g.,
    Class A {
             //Initialize thread prerequisites
            String name;
             Thread th;
           classConstructor(String threadName){
                    name = threadName;
                    th = new Thread(this, name);
                    System.out.println( "New Thread: " +th);          
                    th.start() ;
    }Is this the right way of using threads? Or should threads be started from the main method? What are the merits/demerits in these two approaches?
    Thanks!

    You can start threads from anywhere. After all, you're just creating another Java object and calling the start method on it.
    However, there are places where you shouldn't start threads. Unfortunately, in constructors of non-final classes is one of those places. And here's why...
    If you subclass your class, the subclass constructor will begin by calling one of the constructors in your class (either implicitly or explicitly). In this case, your constructor will create and begin a thread. That thread could potentially call methods on this new object instance (especially as in your case you have passed this to the thread, so it looks likely that it will). The problem is, because we're talking about threads, the thread might call the methods on your class before your constructor or the subclass constructor has completed, and you would therefore be calling methods on an incomplete object which might cause issues.
    For example:
    public abstract class A {
      public A() {
        // create and start thread here
      public abstract int getSomething();
    public class B extends A {
      private static int something;
      public B() {
        // implicitly calls A()
        something = 1;
      public int getSomething() {
        return something;
    }Now, if the thread you started calls getSomething(), the return value might be 0, or it might be 1, depending on how the thread executes in relation to the original thread which is executing the constructors.

Maybe you are looking for