Joining separate threads in different application instances

Is there any way to have a thread running on a machine that will pick up any new request?
If application A is running all day on a server, can I start another instance via command line
that will join that 1st thread/queue, to use it resources, like a connection pool?
Is that just a servlet with a wider scope?

What you are talking about really is starting an application in JVM A, and then running a small auxiliary command in JVM B that communicates with A and tells it to start another thread to perform some task. The communications part of this is done with sockets, RMI, etc, and the threading part is done with a Thread, or the services in java.util.concurrent.

Similar Messages

  • Does a CQC really need a separate thread/event queue per instance?

    Does a ContinousQueryCache really need a separate thread/event queue per instance?
    Is it possible to get multiple cqc's to share a single event queue?

    Test case to reproduce shown below, i.e. new thread per CQC.
    Sample code:
    =====================================
    NamedCache dummyCache = CacheFactory.getCache("A");
    dummyCache.put("hello", "B");
    dummyCache.put("world", "C");
    ContinuousQueryCache cqcA = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "B"), new MultiplexingMapListener() {
    @Override
    protected void onMapEvent(MapEvent mapEvent) {
    System.out.println(Thread.currentThread().getName());
    ContinuousQueryCache cqcB = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "C"), new MultiplexingMapListener() {
    @Override
    protected void onMapEvent(MapEvent mapEvent) {
    System.out.println(Thread.currentThread().getName());
    =================================
    Output:
    EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}
    EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}
    =================================
    Thread dump:
    Full thread dump Java HotSpot(TM) Client VM (11.2-b01 mixed mode, sharing):
    "EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}" daemon prio=6 tid=0x034d8800 nid=0x16b4 in Object.wait() [0x03b2f000..0x03b2fa94]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x22d80068> (a com.tangosol.util.TaskDaemon)
         at java.lang.Object.wait(Object.java:485)
         at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         - locked <0x22d80068> (a com.tangosol.util.TaskDaemon)
         at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
         at java.lang.Thread.run(Thread.java:619)
    "EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}" daemon prio=6 tid=0x034d7400 nid=0x1370 in Object.wait() [0x03adf000..0x03adfb14]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x22d80138> (a com.tangosol.util.TaskDaemon)
         at java.lang.Object.wait(Object.java:485)
         at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         - locked <0x22d80138> (a com.tangosol.util.TaskDaemon)
         at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
         at java.lang.Thread.run(Thread.java:619)

  • Accessing a variable from different application instance in fmis

    Hello everyone i like to know how to declare a global variable in FMS, so that i can access it from different application instance of a same application.
    Thank.

    Hi,
    In such a use case you can use persistent shared object to keep track of all connected users and the instances they are connected to. then when a user connects in application.xml you can check whether that user name and password is valid for a instance. This doc should help you get this achieved http://help.adobe.com/en_US/FlashMediaServer/3.5_Deving/WS5b3ccc516d4fbf351e63e3d11a0773d3 7a-7fff.html
    Thanks,
    Abhishek

  • Connecting to two different database instances from a swing application.

    Hi All,
    I am developing a swing application which needs to interact with two different database instances of two different weblogic servers.
    More eloborately,
    I have some data in DB_Instance1 running on[b] Weblogic_Server1 and I need to insert the same data into DB_instance2 running on Weblogic_server2. Is it possible. Could some explain me how to do that..
    Thanks in advance...
    Sreekanth.

    Hi Rick,
    Try logging onto both Server first. You'll have to use either 2 separate ODBC DSN's or 2 separate OLE DB connections. Set them both for Trusted Authentication, you'll have to configure that on the Server also.Then try your query.
    If that doesn't work then you'll have to create a Stored Procedure or View that can link the 2 Server side.
    Thank you
    Don

  • One instance for two different application

    Hello,
    I have to solve following problem..
    need have one instance of object for two different application..fist is standard SE application and second is EE (web)..
    SE application is a server..listen on and accepting connection from mobile phone..and EE application need to show list of connected devices and should say to SE application that new device was connected..
    I would like to do this without database..only server and web app..
    I have thought about RMI..but hope there is more simple solution..
    Thanks a lot for your ideas.
    Dmitrij

    I would like to do this without database..only server and web app..You have your reasons for wanting this to be the case. If you are sure you don't want a DB, then pass the state of the object between the two ends using XML as the transport form. As someone said, you can use JMS or you can write an HTTP POST or probably other transport mechanisms other people will suggest to actually get it over the wire from one side to the other.
    As to your question of how to sync state, just make the object you're sharing final after it's been created (on the side that creates it) and make the reference that receives it and holds it final also, after you've reconstructed it from the XML you received.

  • Can you show different applications in different Dialog instances?

    Hi,
    We have a requirement but I don´t know if it is possible.
    We have a Portal installation with One CI and 5 DI´s, let´s say that the requirement is to show in CI and DI(1) two applications, in DI(2) and DI(3) three applications different from the other two applications and in DI(4) and DI(5) one application different from the others.
    Is this Posible? most of the applications are built on Webdynpro.
    Thanx in Advanced!
    Gerardo J

    Hi,
    Really creative Solution, you are right this way it should work :O), I´m thinking that the roles will keep showing even though the applications wont work, but I don´t know if the client will like that the menues are displayed and can be selected and the applications wont show, do you know if there is a workaround that can be done on this situation? I was thinking on one but can´t detect a solution to make the roles variable depending on the applications runing.
    Thanx Again I liked that the way you porpoused it is achievable to just run different applications in different nodes.
    Really apreciate it!
    Kind Regards,
    Gerardo J

  • Cannot Open Form Created on Separate Thread After Closing

    My application communicates with a device that has several sensors.  As the sensors collect data, they send messages over the com port.  I have written a class to communicate with the device.  As the messages come in and are processed, the
    class raises events that the application responds to.
    The main window of the application handles the communication with the device and displays several statistics based on the data collected.  When the user presses a button on the device, a specific event is raised.  The main window create a separate
    thread and opens a child window.  When the child window is open, the user opens a valve to dispense the product.  As the product is dispensed, a flow meter connected to the device measures the volume of product dispensed.  The flow meter generates
    messages to indicate the volume dispensed.  I need to be able to send messages from the main window to the child window so that the child window displays the volume.  When the user is done, they close the valve dispensing the product and press the
    "End" button on the child window.  The child window then updates several variables on the main window, makes a couple of database calls to record how much product was dispensed and by whom and then closes.
    I need to run the child window using a separate thread as both windows need to be able to process commands.  If only one window has control the program doesn't work at all.  I have it figured out so that everything is working.  I can open
    the child window, dispense product, se the amount of product dispensed in the child window (the main window processes commands from the device and updates the label on the child window using a delegate), closes the window (using Me.Close()) and updates the
    main display with the updated data.  The problem is that when a user goes to dispense product a second time, I get the following error:
      A first chance exception of type 'System.ObjectDisposedException' occurred in System.Windows.Forms.dll
      Additional information: Cannot access a disposed object.
    I thought that maybe I could hide the window (change Me.Close() to Me.Hide) and then just show it.  When I do that I get this error:
      A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
      Additional information: Cross-thread operation not valid: Control 'frmPour' accessed from a thread other than the thread it was created on.
    Both of these errors make sense to me, I just can't figure out how to make it work.
    First I have to declare the child window as a global variable as I need to access the window from a couple of the event handlers in the main form.
    Public frmMeasure As New frmPour
    When the user presses the button on the device to dispense the product, the event handler executes this code to open the child window.
    Private Sub StartPour(sAuthName As String, sAuthToken As String, iStatus As Integer) Handles Device.Pour
    Dim th As System.Threading.Thread = New Threading.Thread(AddressOf Me.OpenDispenseWindow)
    th.SetApartmentState(ApartmentState.STA)
    th.Start()
    End If
    End Sub
    Which executes this code:
    Public Sub OpenDispenseWindow()
    frmMeasure.sNameProperty = sCurrentUserName
    frmMeasure.sAuthTokenIDProperty = sUserToken
    Application.Run(frmMeasure)
    bAuthenticated = False
    bPouring = False
    dSessionVolume += GetTapConversion(sCurrentValve) * iFinalTick
    UpdateDisplayDelegate(iValveID)
    End Sub
    It doesn't matter if I use Me.Close() or Me.Hide(), both methods fail on the Application.Run(frmMeasure) line with the errors shown above. 
    For the Me.Close() method, my thinking is that the global frmMeasure object is getting disposed when I close the child window.  Is there any way that I can re-instantiate it when I go to display the window again?
    For the Me.Hide method, is there any way that I can track the thread that created it in the main window and when I go to call it a second time, detect that it is already available and just Show() it?
    Any hints, tips or suggestions are appreciated.
    Thanks.
    John
    John

    To be honest, I have only grasped < 100% of your message in detail, but...: Windows that have a parent<->child relation must be running in the same thread. In addition, after closing a modeless window, you must not use it anymore. Instead, create
    a new instance.
    What happens if you do not create a new thread but instead open the child in the same thread (which is obligatory)? You wrote it doesn't work, but I don't know why?
    "First I have to declare the child window as a global variable".
    How do you define "global"? Normally this is a variable in a Module declared with the scope Public or Friend. But I guess you mean a field of the Form (a variable at class level in the Form).
    "I need to be able to send messages from the main window to the child window so that the child window displays the volume."
    Why does the main window has to send the messages? Can't the child window handle the device's messages itself?
    "I need to run the child window using a separate thread as both windows need to be able to process commands."
    Process commands from the device, or commands from the user operating the Forms?
    Armin

  • Export from Crystal Reports 2008 viewer fails if run on separate thread

    I have a windows desktop application written in Visual Basic using Visual Studio 2008.  I have installed and am trying Crystal Reports 2008 to run a report.  Everything seems to work well except that when I preview a report (using the viewer control) and click the export button found in the upper left corner of that control, I get the following message:
    Error 5: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.  Ensure that your Main function has STAThreadAttribute marked on it.  This exception is only raised if a debugger is attached to the process.
    I am a little confused on what to do exactly.  Is the problem because I am running in the Visual Studio 2008 IDE?  It says this exception is only raise if a debugger is attached to the process.  No, I tried running it outside the IDE.  The exception wasn't generated but the application hung when the button was clicked.
    It says the current thread must be set to single thread apartment (STA) mode.  If the report is run on its own thread, is the "current" thread the thread the report is running on or is the main application's UI thread?  I don't think I want to set my main application to single thread apartment mode because it is a multi-threaded application (although I really don't know for sure because I am new to multi-threaded programming). 
    My objective is to allow reports to run asynchronously so that the user can do other things while it is being generated.  Here is the code I use to do this:
        ' Previews the report using a new thread (asynchronously)
        Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
            Dim backgroundProcess As System.ComponentModel.BackgroundWorker
            ' Start a new thread to run this report.
            backgroundProcess = New System.ComponentModel.BackgroundWorker
            Using (backgroundProcess)
                ' Wire the function we want to run to the 'do work' event.
                AddHandler backgroundProcess.DoWork, AddressOf PreviewReportAsynch_Start
                ' Kick off the report asynchronously and return control to the calling process
                backgroundProcess.RunWorkerAsync(sourceDatabase)
            End Using
        End Sub
        Private Sub PreviewReportAsynch_Start(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
            ' The source database needed to call preview report was passed as the only argument
            Call PreviewReport(CType(e.Argument, clsMainApplicationDatabase))
        End Sub
        ' Previews the report.  From the preview window, the user can print it.
        Public Function PreviewReport(ByVal sourceDatabase As clsMainApplicationDatabase) As FunctionEndedResult
            Dim errorBoxTitle As String
            Dim frmPreview As frmReportPreview
            ' Setup error handling
            errorBoxTitle = "Preview " & Name & " Report"
            PreviewReport = FunctionEndedResult.FAILURE
            On Error GoTo PreviewError
            ' Set up the crxReport object
            If InitializeReportProcess(sourceDatabase) <> FunctionEndedResult.SUCCESS Then
                GoTo PreviewExit
            End If
            ' Use the preview form to preview the report
            frmPreview = New frmReportPreview
            frmPreview.Report = crxReport
            frmPreview.ShowDialog()
            ' Save any settings that should persist from one run to the next
            Call SavePersistentSettings()
            ' If we got this far everything is OK.
            PreviewReport = FunctionEndedResult.SUCCESS
    PreviewExit:
            ' Do any cleanup work
            Call CleanupReportProcess(sourceDatabase)
            Exit Function
    PreviewError:
            ' Report error then exit gracefully
            ErrorBox(errorBoxTitle)
            Resume PreviewExit
        End Function
    The variable crxReport is of type ReportDocument and the windows form called 'frmPreview' has only 1 control, the crystal reports viewer. 
    The print button on the viewer works fine.  Just the export button is failing.  Any ideas?

    Hi Trevor.
    Thank you for the reply.  The report document is create on the main UI thread of my application.  The preview form is created and destroyed on the separate thread.  For reasons I won't get into, restructuring the code to move all the initialization stuff inside the preview form is not an option (OK, if you a really curious, I don't always preview a report, sometimes I print and/or export it directly which means the preview form isn't used).
    What I learned through some other research is that there are some things (like COM calls and evidently some OLE automation stuff) that cannot be run on a thread that uses the MTA threading model.   The export button probably uses some of this technology, thus the message stating that an STA threading model is required.  I restructured the code as follows to accomodate this requirement.  Here is a sample:
    ' Previews the report using a new thread (asynchronously)
        Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
            Dim staThread As System.Threading.Thread
            ' Start the preview report function on a new thread
            staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep1)
            staThread.SetApartmentState(System.Threading.ApartmentState.MTA)
            staThread.Start(sourceDatabase)
        End Sub
        Private Sub PreviewReportAsynchStep1(ByVal sourceDatabase As Object)
            Dim staThread As System.Threading.Thread
            ' Initialize report preview.  This includes staging any data and configuring the
            ' crystal report document object for use by the crystal report viewer control.
            If InitializeReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase)) = FunctionEndedResult.SUCCESS Then
                ' Show the report to the user.  This must be done on an STA thread so we will
                ' start another of that type.  See description of PreviewReportAsynchStep2()
                staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep2)
                staThread.SetApartmentState(System.Threading.ApartmentState.STA)
                staThread.Start(mcrxReport)
                ' Wait for step 2 to finish.  This blocks the current thread, but this thread
                ' isn't the main UI thread and this thread has no UI anymore (the progress
                ' form was closed) so it won't matter that is it blocked.
                staThread.Join()
                ' Save any settings that should persist from one successful run to the next
                Call SavePersistentSettings()
            End If
            ' Release the crystal report
            Call CleanupReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase))
        End Sub
        ' The preview form must be launched on a thread that use the single-threaded apartment (STA) model.
        ' Threads use the multi-threaded apartment (MTA) model by default.  This is necessary to make the
        ' export and print buttons on the preview form work.  They do not work when running on a
        ' thread using MTA.
        Public Sub PreviewReportAsynchStep2(ByVal crxInitializedReport As Object)
            Dim frmPreview As frmReportPreview
            ' Use the preview form to preview the report.  The preview form contains the crystal reports viewer control.
            frmPreview = New frmReportPreview
            frmPreview.Report = DirectCast(crxInitializedReport, ReportDocument)
            frmPreview.ShowDialog()
        End Sub
    Thanks for your help!
    Andy

  • HELP!!: Two server application instances could work in the same port?

    Hi everybody!!!
    i have two server application instances over the same JVM and both of them need to get requests from the same port, how can i get this??
    I`m not interested on using RMI, and i wouldn`t like to use sockets, because i have already using XML-RPC, so if you can tell me how can i get this without using sockets nor RMI, please help me...
    I don�t if there any way using threads??
    thanks a lot,
    JCPARRAM

    Two sockets can't be bound to the same port on the same machine at the same time. This means that one application can't have two sockets listening on the same port and that two applications can't each have a socket listening on the same port (no matter what language they are written in, and, if they are in Java, no matter whether they are on the same JVM or not).
    Your only solution is to make one of the server applications listen on a different port.

  • DR database Needs Different Application Schemas

    I am looking for experienced thoughts on Logical Standby database configurations using Data Guard...
    I have a Production database containing three application-specific schemas along with a handfull of schemas supporting business data. The DR site needs to receive replicated business data, but allow extra schemas to exist to support DR-side apps, which have a configuration based on location. E.g. the DR-side apps need to be setup using paswords that are hashed using hostnames, which are different given the DR site...
    My initial thoughts are to use a Logical Standby configuration to solve this, opening the standby database to allow the creation of extra application schemas.
    Can anyone tell me how suitable a solution this is, or if there is a better alternative?
    Oracle documentation explains that Logical standby database are generally used to off-load reporting and backups so I am concerned that my solution is going to produce management problems later down the line.
    Any comments much appreciated!
    Richard

    Many thanks for getting back to me!
    I agree that Logical standbys are not ideal for DR, but I can't see any other option in my situation. The problem is that a Physical standby won't work because I need the DR database to contain different application data to the Live site.
    Can you think of any other approved/reccommended solutions or technologies that will help, where Prod and DR are both single instance 10g DBs?
    One thought is to have separate databases on the DR side: one to host the app schemas and one acting as a physical standby for business data.
    Many thanks again,
    Richard

  • JFrame thread in ClientServer application?

    I am creating a client/server application, mostly in Java.
    It all runs on one box.
    The reason for the client/server setup is that the application will consist of modules in different languages
    with one module written in Visual Basic with a TCP/IP interface.
    I will have something like this:
    myJavaServer
    |_ myVBModule
    |_ myC++Module
    |_ myJavaModule
    myJavaServer is a thread.
    myJavaServer and myVBModule will communciate via TCP/IP, in which each has a state machine
    myJavaServer and myC++Module will probably communicate via the JNI.
    myJavaServer will simply call myJavaModule methods.
    myJavaServer calls myVBModule, myC++Module, and myJavaModule sequentially,
    i.e. it can't call myC++Module until myVBModule is done, can't call myJavaModule until myC++Module is done, and when myJavaModule is done, it will loop back and call myVBModule.
    Each is acting on the same set of data.
    One part of this data is a 2D array which I would like to display and refresh once each time around the loop
    The display will be some JPanels on a JFrame.
    How do I best integrate this with the rest of the program?
    Do I make it a separate Thread?

    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads3.html

  • Switch to different application server in ABAP program

    Hello everyone,
    I am currently working on some ABAP objects classes and tool programs for additional user administration functionality. We are runnig a SAP ERP system with distributed application servers and active logon load-balancing for users.
    I'd like to switch to a different application server from within my program in order to get all relevant information for an active user. So far I only found the function TH_SELECT_SERVER (from the function group THFB) for this, but this uses a separate dialog for interactively switching to another application server.
    I could use RFC calls with a lookup table for the destinations of individual application servers, but this would not be as flexible. Also I would have to create some wrapper code for standard functions which are not defined as RFC-usable. So I would rather like to switch to the other server instead.
    What I'd like to do instead is switching to another server from a user-related server list without any additional interaction in order to run a function locally on the other server. Does anybody know some function, object method etc. which will do the trick?
    Greetings,
    Markus.

    Hello Thomas,
    Bingo !!!
    I debugged the report program RSM51000_ALV & found the sub-routine SM51_USER_CMD.
    The SY-UCOMM for our purpose is 'RLOG'. and it utilises the FM 'TH_REMOTE_TRANSACTION' )
    Hope this will be of some help to the thread starter.
    BR,
    Suhas

  • Looking up EJBs at different OC4J instances

    Hi there,
    I´m facing a little weird problem for looking up EJBs deployed at remote OC4J instancias. That is, my application runs at an OC4J instance at host A while some external components, needed by my application, run at an OC4J instance at host B.
    Host A runs OC4J version 10.1.3.2 while host B runs OC4J version 10.1.3.3. When I try to lookup some EJB I get the following exception:
    Caused by: java.io.InvalidClassException: oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl; local class incompatible: stream classdesc serialVersionUID = -7010736017799296921, local class serialVersionUID = 5036353448034635021
    It seems that the serialVersionUID field was not overriden in the class ManagedConnectionFactoryImpl, so each OC4J version has a ManagedConnectionFactoryImpl class with a distinct serial version.
    Well, how do I turn around this? Is this a limitation of OC4J that I should cope with (not being able to exchange data through components deployed at different OC4J versions)?
    Regards,
    Loreno

    There are some days since this thread was created. Does the miss of an answer means that it is no possible to exchange data through EJBs deployed at different OC4J instancies, with different versions?

  • Does URLLoader load data in a separate thread?

    I understand the Flash and AS3 is single-threaded, at least at the user level.
    However, I would like to understand how asynchronous data loading is handled by the Flash player.
    For instance, if I run CPU-intensive code that runs beyond the normal frame (lets say it runs on ENTER_FRAME, and consumes 1/4 per call).  Does this leave any CPU cycles to load data from a URLLoader?
    If http loading is truly synchronous, right down to handling the TCP/IP stack, one would get horrible performance.
    In Windows programming, I can do http access asynchronously (in which case the Windows libraries are doing either input on a separate thread, or doing hardware-level interrupts to handle the data -- I provide an asynchronous callback that may be on its own thread).  Or, I can do synchronous download, in which case there will be hardware buffering, but my application is actively waiting for each buffer of data to be delivered by the hardware/OS combination.
    URLLoader is asynchronous, but what does that mean?  Does it mean that I can run the CPU and still download data?  Or, will my download speed slow to a crawl if my Flash application is under heavy CPU load?
    Understanding how this works will help me design my product better, which both uses a lot of CPU, and downloads a lot of data (to the bandwidth limit of the network, if possible).

    >>"no data handling can occur if the cpu is 100% occupied.  so, the download will slow/stop."
    Operating systems have pre-emptive multitasking, so if download were in another thread, it could still operate.
    My CPU has 4 cores.  So by 100% busy, I meant that I am getting close to maxing out the main thread of Flash, which only uses one core.
    >>data downloading being asynchronous means while data is downloading the cpu and your actionscript can do other things
    This is my question exactly.  Asynchronous can mean many things.  At the lowest layer, at least one "buffer" of data (who knows what size) has to be downloaded in a separate thread, or by hardware, or by the browser, etc.  Flash could have a background thread internally that grabs data from this buffer, and does something with it.  Or, Flash could rely on polling this buffer on the main thread in-between frames.  The last method would be bad, as it would rely on the user not using the complete CPU usage per frame.
    The real truth may be a combination of these two -- it may download in a background thread, but only up to some limit, at which point the Flash main thread has do internally grab it?
    >>but it is possible to have other actionscript tasks or flash animations interfere with downloading.
    My question is, how much care and feeding does the download require?  Does it work quite well by itself, and is rarely affected by AS3 CPU use, or is there a requirement to not use up all of the CPU per-frame in order for the download to proceed?  In my case, I may stretch my frames out to 1/4 second, as I do intensive CPU work.  Would this slow or stop my downloads?
    Thanks for the helpful reply -- I would love a bit more detail though.
    Also, I'm more likely to be using URLStream in my actual implementation.

  • Having 2 objects running in separate threads

    I am accessing cobol programs using the microfocus runtime for java. The problem with it is that a you can only run one instance of a cobol program at the same time, unless they are in separate threads.
    Example:
    CobolTextSearch cobol1 = new CobolTextSearch();
    CobolTextSearch cobol2 = new CobolTextSearch();
    cobol1.execute("FAMILY");
    cobol2.execute("HISTORY");
    System.out.println(cobol1.getRecord());
    System.out.println(cobol2.getRecord());The output of this program results in HISTORY for cobol1 and HISTORY for cobol2. Where as if they were run in separate threads, I would have got FAMILY for cobol1.
    So my question is, is there any way I can run these two objects in separate threads so that any time I access the object it will be in its own thread? I cant just run them in separate threads on the execute because each getRecord is interfacing with cobol. After execute I want to be able to read values from the cobol files to see if they match without having to read each record into memory on the java side.

    No you are not missing anything, you just create a new thread each time you run something or you have to make a setter method to accept parameters for the next run and then a seperate method to actually make your routine execute.
    public void setTask(String s){
      task2Execute = s; //task2Execute is global to the methods
    public boolean runTask(){
      CobolTextSearch cobol = new CobolTextSearch();
      cobol1.execute(task2Execute);
    //  other logic
    }Here is what the docs say about threads: A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.

Maybe you are looking for

  • How to sync tables in scheduler DB#1 and scheduler DB#2

    Hi experts the issue is as following ==== Customer's BIP environment is as following [Publisher 1] [Publisher 2] ---------+---------> [ scheduler DB 1] (primary)                                                  [ scheduler DB 2] (stand by) BIP :10.1.

  • Are iPad and iPhone built in microphones mono or stereo?

    That's my question.

  • Can '&' work in host command?

    Hi, I tried to use HOST built-in to send command to Unix but Forms can not display any error. To trap error message, I tried to redirect stderr to file, but Forms seems to fail to send special character '&' to Unix. For example: HOST('path/shell_scri

  • Backing up iPhone 5

    Do I still need to sync my photos from iPhone to iPhoto even though it is synced to iTunes?

  • SharePoint keep asking for password

    I have few users who add sharepoint site to Outlook client. When they tried to access sharepoint site thru outlook, it keeping prompt for credential, even though they key in correct username and password. User's PC running on WindowsXP and Outlook 20