Multi-threaded file conversions bug

Why with 5 PDF Generator User Accounts I get this?
WARN  [com.adobe.service.ImpersonatedConnectionManager] BMC028: Service PDFMakerSvc: Reducing maximum pool size from 20 to 4 to match number of impersonation credentials.
Why with 6 PDF Generator User Accounts  I get  this?
WARN  [com.adobe.service.ImpersonatedConnectionManager] BMC028: Service PDFMakerSvc: Reducing maximum pool size from 20 to 5 to match number of impersonation credentials.
Why with more than 4 user I randomly get this (in multithread-conversion of one identical document)?
INFO  [com.adobe.pdfg.GeneratePDFImpl] ALC-PDG-001-000-Conversion failed : ALC-PDG-010-012-PDFMaker reported an error while printing the document.
INFO  [com.adobe.pdfg.GeneratePDFImpl] ALC-PDG-001-000-Trying to find a fallback route if available
INFO  [com.adobe.pdfg.GeneratePDFImpl] ALC-PDG-001-000-Couldn't obtain fallback filetype setting. Cannot try fallback route

Thank you  for your reply Hodmi   I didnt knew about that feature of invokeDDX() function.It help me a lot.
Hodmi wrote:
       What I understood from your reply is I don't need to do any thing with those user except just add those user to livecycle
           application,and I must ensure that those user must have admin right,is that right?
That's pretty much correct.  I don't believe they need admin rights, just the rights to launch the native apps.
May be you are right,but I read it at "Installing and Deploying LiveCycle® ES2 Using JBoss® Turnkey Adobe" pg no 60 at section 6.14.7  that  " Click Add and enter the user name and password of a user who has administrative privileges on theLiveCycle ES2 server
any way no prob with that......

Similar Messages

  • Multi-thread file reading

    Hi,
    I've got a tricky question: I have to read large files (over 150 MB) - I found here several topics about reading such a large files, but all examples were about single-threaded reading from file... Do you think, multi-threaded reading would be faster? I am in quite a dilemma: multiple threads in general means faster processing, but in this case, all threads are reading from the same source/file
    (I use javax.mail.util.SharedFileInputStream for multi-threaded file reading - each stream in separated thread)
    so what do you think, which is faster: single-thread or multiple-thread? and if so, how many threads would be fine - 2, 3 or 4?
    thanks a lot

    kvasoo wrote:
    Herko_ter_Horst wrote:
    The I/O thread processing thread(s) approach will work when the processing takes more time than the I/O (i.e. when the medium can transfer information faster than a single thread can process it).it is very likely that processing will take more time then file reading - there will be 5-7 regex to match per line, sometimes object creation and filling object fith some data
    so it seems to be just like I wrote some posts before: while one thread is reading data from file, another could process already read data - I am just considering malcolmmc's idea of blocking queue - one thread to perform I/O operations and one thread to process data - these threads would be connected through blocking queue....hmm that sounds good to me.. thanks malcolmmc
    thank you guys for your help & suggestions and if you still have something to advise me, I will be thankfulSeparation of concerns, dude. Read the raw data in, in one thread, and split out the processing to multiple threads. I really advise you take the time to actually measure the performance of the multi-threaded processing vs the single-threaded one though. I mean, really do actually do that. Don't just assume - as so many people do - that throwing more threads at every problem will always speed it up, because it's so often not the case.

  • Multi threading under single file channel

    Hi,
      We have File-Proxy scenario .
    We are using fCC sender channel and using
    recordset sequence as varaibale
    recordsets per message was 250.
    When large size file like 2GB was processed, PI is taking 45-50 min to process the file and from proxy end its taking 8 hrs to process this file.
    we are using one channel and 250 recordsets per message by chunking file and process to target. We are following EOIO for sequence for these chunk files.
    with this approach in PI target system proxy is taking huge time to process.
    experts suggested using multi threading and multiple channels are the ideal solution for this issue.
    am expecting with multiple channels and multi threading  will cause issue for receiver proxy  because of more objects and current approach is fine.
    Please suggest any other alternatives we can acheive in PI with respect to this issue?
    Note: I checked blog for file chunk option under Adv parameters and I cant use that here as FCC and Mapping is there .
    Rgds,
    aman

    Hi Aman,
    We had file to proxy interface and the XML payload of the proxy was around 400mb...to reduce the time taken in PI in mapping step we reduced the XML payload of the proxy by cutting the XML tagnames.
    for example an xml field <firstname>Anand</firstname> was converted to <f>Anand</f>
    with this we were able to achieve about 40-50% reduction in XML payload the file and a good improvement in the time taken by PI mapping to process the file.
    Hope it helps,
    Thanks,
    Anand

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

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

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

  • Multi-Threaded FTP

    Multi-Threaded FTP was a huge attraction for me, and one of the features that sold me on upgrading to Dreamweaver CS6.  However, I haven't seen any sign of it in the product or any documentation to help me use it.  My files keep transferring in the traditional one-at-a-time way.
    Is there something I need to do to enable this feature? Has anybody used this feature yet?

    Might not help but I saw this in the comments on David Powers' blog
    http://foundationphp.com/blog/2012/04/23/my-verdict-on-dreamweaver-cs6/
    "Multi-thread FTP is the default in Dreamweaver CS6. You can neither turn it on nor off. It handles a maximum of three transfers simultaneously in either direction (so you can download at the same time as uploading). However, it doesn’t work with Check In/Check Out."
    He also has the following comments in the body of the blog entry:
    Multichannel FTP
    Let’s be honest. In the past, Dreamweaver’s FTP client was a dog. Not any more. It now supports multichannel transfers, and can even download at the same time as uploading. Orange arrows indicate items queued for transfer. When the transfer begins, the arrow turns green. And if you’re transferring a large item, hovering over the filename displays a tooltip of how much of the file has been transferred. With Dreamweaver CS5.5, it took more than 90 minutes to  upload a WordPress site on my internet connection. Now, it’s more than ten times faster.
    The FTP error messages are also more meaningful. No one is likely to buy Dreamweaver CS6 for its FTP client alone, but this is a major improvement to the program.

  • Acrobat 9 Pro Extended Distiller - Multi-threaded?

    I am using distiller on some fairly large postscript files (also large numbers of small postscript files) and am running into what appears to be machine limitations. I'm running on a 32 bit workstation with 3gb RAM and an intel core duo CPU. Looking at the perf monitor, my processes are not RAM limited and I never seem to get the CPU use above 50% which indicates to me that distiller may not be multi-threaded. Is that the case? If so, is there a way to get distiller to use both CPUs? (or all 4 on a quad core)

    I am also facing the same issue. Although you can run multiple instances of Distiller using switch "N"
    acrodist.exe -N
    But don't know how to distribute the watchedFolders among them.
    Even though you can specify the Watch Folders once the instances are up and running.. but in case if you close the instances and start them again.. only one instance will have all the watched folders with it.
    So don't know the solution to this, anyone pls help
    Thanks in Advance
    Naveen Sharma

  • Multi-Threaded server using  ThreadPool

    Dear friends,
    I am writing a client-server program in which the client and server communicate using SUN-RPC. The client reads a file containing some numbers and then spawns threads which it uses to request the server for a service. These threads are executed using a thread pool. Till this time, it's working fine. But when it comes to the server, the real trouble begins because it too needs to be made a multi-threaded one using thread pooling. The server has to capture the call information for each request for the service and then pass this information to a thread/runnable object in whose run() method the code for execution of the service would be present. Since the tasks(requests for the service) are not present already, i am unable to execute the server side threads in a loop using a thread pool. How to solve this problem? Kindly help.
    Thanks,
    Subhash

    The server has to capture the call information for each request for the serviceWhy?
    and then pass this information to a thread/runnable object in whose run() method the code for execution of the service would be present.Why can't the run() method get the call information when it starts? That's what's normally done. The server's accept loop mustn't do any other I/O: otherwise a rogue client can block the server complete.y

  • Oracle 8 on Linux in Multi-Thread mode

    I installed Oracle 8.0.5.0.0 on Linux RedHat 5.1
    But I cann't startup database in multi-threaed mode.
    When I try to startup DB the errors follow
    SVRMGR> startup;
    ORA-00101: invalid specification for system parameter
    MTS_DISPATCHERS
    ORA-00102: network protocol
    (ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp)) cannot be used by
    dispatchers
    My configuration files are:
    listener.ora
    LISTENER =
    (ADDRESS_LIST =
    (ADDRESS= (PROTOCOL= IPC)(KEY= orcl))
    (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
    (ADDRESS= (PROTOCOL= TCP)(Host=
    pcstar.kharkov.ua)(Port= 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME= pcstar.kharkov.ua)
    (ORACLE_HOME= /usr/oracle)
    (SID_NAME = orcl)
    (SID_DESC =
    (SID_NAME = extproc)
    (ORACLE_HOME = /usr/oracle)
    (PROGRAM = extproc)
    STARTUP_WAIT_TIME_LISTENER = 0
    CONNECT_TIMEOUT_LISTENER = 10
    TRACE_LEVEL_LISTENER = OFF
    tnslistener working normally
    tnsnames.ora
    extproc_connection_data =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
    (CONNECT_DATA = (SID = extproc))
    orcl =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL= TCP)(Host=
    pcstar.pcstar.kharkov.ua)(Port= 1521))
    (CONNECT_DATA = (SID = orcl))
    orcl_BEQ =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = BEQ)(PROGRAM = /usr/oracle)
    (argv0 = oracleorcl)
    (args = '(DESCRIPTION =
    (LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
    (envs =
    'ORACLE_HOME=/usr/oracle,ORACLE_SID=orcl')
    initorcl.ora
    mts_dispatchers="tcp,1"
    mts_max_dispatchers=3
    mts_servers=1
    mts_max_servers=5
    mts_service=orcl
    mts_listener_address="(ADDRESS=(PROTOCOL=tcp)(Host=pcstar)(Por
    t=1521))"
    If anybody started server in Multi-Thread mode, mail me
    [email protected]
    Best Regards!
    Gennady Saldiga
    null

    Yes, the MTS for TCP protocol does not work. A patch will be
    released soon for the production release with the fix for
    the MTS problem.
    Maturi
    Satoshi Hirai (guest) wrote:
    : Gennady Saldiga (guest) wrote:
    : : I installed Oracle 8.0.5.0.0 on Linux RedHat 5.1
    : : But I cann't startup database in multi-threaed mode.
    : : When I try to startup DB the errors follow
    : : SVRMGR> startup;
    : : ORA-00101: invalid specification for system parameter
    : : MTS_DISPATCHERS
    : : ORA-00102: network protocol
    : : (ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp)) cannot be used by
    : : dispatchers
    : : My configuration files are:
    : : listener.ora
    : : LISTENER =
    : : (ADDRESS_LIST =
    : : (ADDRESS= (PROTOCOL= IPC)(KEY= orcl))
    : : (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
    : : (ADDRESS= (PROTOCOL= TCP)(Host=
    : : pcstar.kharkov.ua)(Port= 1521))
    : : SID_LIST_LISTENER =
    : : (SID_LIST =
    : : (SID_DESC =
    : : (GLOBAL_DBNAME= pcstar.kharkov.ua)
    : : (ORACLE_HOME= /usr/oracle)
    : : (SID_NAME = orcl)
    : : (SID_DESC =
    : : (SID_NAME = extproc)
    : : (ORACLE_HOME = /usr/oracle)
    : : (PROGRAM = extproc)
    : : STARTUP_WAIT_TIME_LISTENER = 0
    : : CONNECT_TIMEOUT_LISTENER = 10
    : : TRACE_LEVEL_LISTENER = OFF
    : : tnslistener working normally
    : : tnsnames.ora
    : : extproc_connection_data =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
    : : (CONNECT_DATA = (SID = extproc))
    : : orcl =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL= TCP)(Host=
    : : pcstar.pcstar.kharkov.ua)(Port= 1521))
    : : (CONNECT_DATA = (SID = orcl))
    : : orcl_BEQ =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL = BEQ)(PROGRAM = /usr/oracle)
    : : (argv0 = oracleorcl)
    : : (args = '(DESCRIPTION =
    : : (LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
    : : (envs =
    : : 'ORACLE_HOME=/usr/oracle,ORACLE_SID=orcl')
    : : initorcl.ora
    : : mts_dispatchers="tcp,1"
    : : mts_max_dispatchers=3
    : : mts_servers=1
    : : mts_max_servers=5
    : : mts_service=orcl
    mts_listener_address="(ADDRESS=(PROTOCOL=tcp)(Host=pcstar)(Por
    : : t=1521))"
    : : If anybody started server in Multi-Thread mode, mail me
    : : [email protected]
    : : Best Regards!
    : : Gennady Saldiga
    : Hi!
    : Same problem occured on my environment (Debian GNU/Linux 2.0).
    : But I succeeded to start Multi-thread server on ipc protocol.
    : My current configuration file (mts_* in init.ora) as follows:
    : mts_dispatchers="ipc,1"
    : mts_max_dispatchers=10
    : mts_servers=1
    : mts_max_servers=10
    : mts_service=orcl
    : # I confirmed mts_listener_address syntax by manual and
    : # v$parameter.
    : # Net8 Admn man says: If you have multiple MTS_LISTENER_ADDRESS
    : # parameters, they must be adjacent to each other in your
    : # initialization file.
    mts_listener_address="(ADDRESS=(PROTOCOL=TCP)(host=j-00872)(port=
    : 1521))"
    : mts_listener_address="(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))"
    : So I tested MTS_DISPATCHERS parameter's other syntax.
    : The test results are:
    : # mts_dispatchers="ipc,1"
    : # OK
    : # mts_dispatchers="tcp,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="TCP,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="ipc,1","tcp,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp))"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=NO)(PROTOCOL=tcp))"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=YES)(PROTOCOL=ipc))"
    : # OK
    : # mts_dispatchers="(PROTOCOL=IPC) (DISPATCHERS=3)"
    : # OK
    : # mts_dispatchers="(PROTOCOL=TCP) (DISPATCHERS=3)"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))
    : (dispatchers=3)"
    : # OK
    mts_dispatchers="(ADDRESS=(PROTOCOL=TCP)(host=j-00872)(port=1521)
    : ) (dispatcher
    : s=3)"
    : # ORA-00101,ORA-00102 occured
    mts_dispatchers="(description=(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))(
    : connect_data=
    : (sid=orcl))) (dispatchers=3)"
    : # OK
    mts_dispatchers="(description=(ADDRESS=(PROTOCOL=TCP)(host=j-0087
    : 2)(port=1521)
    : )(connect_data=(sid=orcl))) (dispatchers=3)"
    : # ORA-00101,ORA-00102 occured
    : ### While the test, sometimes ORA-00472 (ORA-00472: PMON
    process
    : ### terminated with error) occured when instance shutdown.
    : ### I think the error reported in another message
    : ### on the same thread.
    : It seems dispatcher is not binded to tcp protocol adapter.
    : Does anybody have more information about Multi-thread server
    : using TCP protocol.
    : ### Please forgive my bad english.
    : Thank you.
    : Satoshi Hirai
    null

  • Analysis for Office support multi thread?

    Does Analysis for Office support multi thread/core? If so, what verison? I tried searching around this site as well as note 1466118 - Hardware & Software requirements for Analysis, edition for MS Office but was unable to find an answer.
    I am on an Intel dual cpu with hyper threading turned on so it essentially looks like 4 cores. When I execute an Analysis View, I rarely see the EXCEL.EXE process go above 25% CPU utilization. I have plenty of RAM and hard drive space.
    64bit Windows 7
    32bit Office 2010
    AAO 1.3.5.2288
    Thanks

    I found the following info at:
    Excel 2010 Performance: Performance and Limit Improvements
    Large Data Sets and 64-bit Excel
    The 64-bit version of Excel 2010 is not constrained to 2 GB of RAM like 32-bit applications. Therefore, 64-bit Excel 2010 enables users to create much larger workbooks. 64-bit Windows enables a larger addressable memory capacity, and 64-bit Excel is designed to take advantage of that capacity. For example, users are able to fill more of the grid with data than was possible in previous versions of Excel. As more RAM is added to the computer, Excel uses that additional memory, allows larger and larger workbooks, and scales with the amount of RAM available.
    In addition, because 64-bit Excel enables larger data sets, both 32-bit and 64-bit Excel 2010 introduce improvements to common large data set tasks such as entering and filling down data, sorting, filtering, and copying and pasting data. Memory usage is also optimized to be more efficient, in both the 32-bit and 64-bit versions of Excel.
    Multi-Core Processing
    Additional investments were made to take advantage of multi-core processors and increase performance for routine tasks. Starting in Excel 2010, the following features use multi-core processors: saving a file, opening a file, refreshing a PivotTable (for external data sources, except OLAP and SharePoint), sorting a cell table, sorting a PivotTable, and auto-sizing a column.
    For operations that involve reading and loading or writing data, such as opening a file, saving a file or refreshing data, splitting the operation into two processes increases performance speed. The first process gets the data, and the second process loads the data into the appropriate structure in memory or writes the data to a file. In this way, as soon as the first process beings reading a portion of data, the second process can immediately start loading or writing that data, while the first process continues to read the next portion of data. Previously, the first process had to finish reading all the data in a certain section before the second process could load that section of the data into memory or write the data to a file.

  • Crystal Report XI u2013 Multi Thread - function PEOpenEngineEx failed. Reason:

    In Crystal Report XI u2013 Multi Thread - function PEOpenEngineEx failed. Reason: Report engine not opened
    Hi
    I am using Crystal report XI with Delphi 7
    OS: Windows XP.
    Delphi 7
    CR Version: Crystal Report XI
    In Crystal Report XI While calling PEOpenEngineEx() by setting Engine option as multi thread, It failed with error message u201CError:512 Report Engine Not Openedu201D
    Code Change in Delphi 7 UCrpe32.pas (Crystal Reports XI Release 1 - Service Pack 3 and Service Pack 4)
    aEngineOptions.openEngineType := PE_OE_MULTI_THREADED;
    FEngineOpened := FCrpeEngine.PEOpenEngineEx(EngineOptions);
    I tried the same with Crystal Report 8.5 (above mentioned code change) Function PEOpenEngineEx() working fine.
    How to overcome this error to make work Multi Thread using CR XI?

    I found that it is bug Release 2 and the script server_patch_xir2 resolved it.

  • Some general questions about multi-threading

    Hey Everybody,
    I have a dilemma with a multi-threaded program that I have written.
    Well to be truthful I actually wrote the program with no consideration whatsoever for multithreading.
    As a result of this complete lack of concern I get a completely hung user interface.
    My program performs a lot of network communications over URL��s and also writes information from URL��s to disk. The combination of networking and I/O in my program and the fact that I have not built multi-threading into the program has lead to complete failure of the user interface. When I say complete failure I mean complete failure. If it were only button��s not responding then I wouldn��t be all that worried, however the entire drawing area of my programs ��Frame�� completely freezes. It��s cool if nothing is maximized or minimized over the frame but as soon as this happens my programs drawing area has a ��serious hang over!��.
    I have begun learning about threads, in principle they sound wicked however in practice they have proven to be a brain tease (oops �K.. honesty).
    The difficulty of threads should not be all that daunting to me, however I have a couple of very simple questions that I would love to have answered�K..anybody out there!!!!!!!!!
    This is the normal basic method of running a thread that I have been attempting to incorporate into my program:
    1). Extend the thread class,
    2). Override the run() method in the subclass (created from step 1),
    3). Create an instance of the subclass,
    4). Call the start() method on the instance (from step 3).
    I have read that every statement the thread will execute is contained within it��s run() method.
    Question 1). This being the case is it possible to have member variables or methods inside a class that extends thread? Please explain!
    Question 2). Can a class that extends thread contain a constructor? Please explain!
    Question 3). If a subclass of thread cannot contain a constructor as I assume to be the case then how can code executing within the newly spawned thread reference information from the object that spawned it?
    If anybody out there on the great net can answer even half of one of these questions I will be more than grateful. Thanks for your time, and rock on Java!
    David

    Thread t = new Thread(MyRunnableDerivedClass);
    t.start();I hope it is understood that MyRunnableDerivedClass is actually an object of the MyRunnableDerivedClass. sorry for the confusion.
    so here's a thread that reads from a file using constructors, member variables, other funcs. It's not optimal but shows use of all of the above. I just typed this in so there are probably syntax errors, but you should get the point.
    public class ThreadedFileReader implements Runnable
        private File m_File;
        byte[] contents = new byte[0];
        public ThreadedFileReader( File f )
           m_File = f;
        public void run()
            BufferedInputStream bis = null;
            try
                bis = new BufferedInputStream( new FileInputStream( m_File ));
                int avail = bis.available();
                while (avail > 0)
                    int oldLen = contents.length();
                    contents = expand( contents, avail );
                    bis.read( contents, oldLen, avail );
                    avail = bis.available();
            catch (Exception e)
            { //do something witty
            finally
                try{ if (bis != null) bis.close(); } catch (Exception e){}
       private byte[] expand( byte[] oldBuf, int addedLen )
          byte[] newBuf = new char[oldBuf.length + addedLen];
          System.arrayCopy( newBuf, 0, oldBuf, 0, oldBuf.length );
          return newBuf;
       public byte[] getContents()
           return contents;
    //here's where we use it
    File f = new File( "c:\myfile" );
    ThreadedFileReader tfr = new ThreadedFileReader( f );
    Thread t = new Thread( tfr );
    t.start();
    t.join();
    // At this point the thread has died, but the thread object still exists
    byte [] data = tfr.getContents();

  • Multi-Instrument + Multi-Thread problem found

    Right.....I have done a lot of research on why logic was not multi-threading correctly and have narrowed it down to one problem...using Kontakt as a multi instrument.
    My Mac is a 2 x 2.26 GHz Quad-Core Intel Xeon. This means that it is capable of distributing work loads over the multiple cores of the CPU to prevent core audio overloads from happening.
    If I run any plug ins in stereo or mono mode, the CPU acts as it should; I will load up a program, add processing and when the load is becoming a strain for the CPU, I use a bus send and work on that, then the workload is redistributed across more of the cores by logic, allowing me to continue working.
    However, I need to use Kontakt as a multi instrument. I usually have 3 instances of Kontakt open and on each one of these, I usually have a minimum of 10 outputs being sent to the aux channels of logic. Therefore using Kontakt as a stereo instrument is not an option, as I would have to open around 30 instances!
    Here is the problem; say for example, in Kontakt I send a kick drum out of Kontakt into AUX 3 + 4. The AUX channel in logic will being to show output. I can now EQ this single kick drum seperate from any other sound in logic.
    If I began to add processor heavy plug ins to this AUX output, rather than share the workload across the cores as it should and does with stereo instruments, logic now only uses a single core and it will core audio overload very quickly.
    As I said, this only happens when I set up Kontakt as a multi instrument. The main problem is when I begin to have many different outputs from my 3 instances of Kontakt, as by this stage, many different sounds will have processing. All 3 multi instruments and their processing are then controlled by the single processor and the other 7 are almost inactive! It therefore becomes impossible to use Kontakt and I have to switch to stereo instances. This happens for all multi-instruments not just Kontakt.
    I have just purchased Kontakt 4, I am upgrading to OSX 10.6 (Snow Leopard) and am updating Logic to v9.1. (From v9.0) Will this help at all? Is there an answer to this problem or will I just have to open 30 stereo and mono instances of Kontakt to continue working!
    I have included a link to a ZIP file with two photos of the problem. In the photo named MASSIVE. I have one instance of massive running as a stereo instrument. It is sent to a BUS where I applied the WAVES L316 Limiter. I did this multiple times and if you can see on the system performance (Top right) Logic is sharing the workload over the processors as it should.
    In the second picture named KONTAKT MULTI - I have done the same thing, but I have opened Kontakt as a multi instrument, sent a kick drum to AUX 2 and then forwarded this to a send where I applied the same WAVES L316. You can see on the system performance meter (Top Right) that Logic now does not re-distribute the workload, it is using one core and anymore plug ins applied to the AUX or bus channels relating to Kontakt will now make it core audio over load, even though now I am using far less processing.
    PHOTOS: http://www.sendspace.com/file/og8a94

    Ditto
    Using Pro 8 Studio, I had this problem after installing Snow Leopard.
    Invested £159 in Pro 9 update, same problem.
    This has stopped most of my work since my external WK4 sounds are superior to the included software sounds.
    As suggested, will now report since since it obviously seems to be a general problem.

  • Asynch Event Gateway not multi-threaded?

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

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

  • Multi-threaded performance server using 2 ports to two-way communication

    Hi, I'm new in the forums so welcome everyone. I'm developing now an online computer game based on orginal Polish board-game, but it doesn't mean. Important is that I need to develope a high-performance multi-threaded server, which can serve... let's say few hundres of games, and a thousend of players simulateously. My server works on two ports/sockets.
    First one is represented by "ServerSocketChannel clientConSsc" in my code. The main thread in my server class which invokes the method "run()" (which You can see below), registers clientConSsc with Selector and then repeatingly accepts incoming connections from clients on this socket. When connection(channel) is estabilished and clients wants to write some request to this channel, the main thread on server creates a new instance of class "RequestHandler" which extends Thread and handles this request (reads the request from channel, makes some changes on server, spreads some new messages to other clients in the same game and so on... everything on the same socket/port/channel). Then the channel/connection is closed by the server - I call such connections: "a short connections". In the same time the main thread continues the loop and is still able to accept connections from another players. That's the idea of multi-threaded server, right? :) And to this point, everything works fine, but... what if the server wants to trigger some new command, write new information to client?
    Server could have tried to open a SocketChannel to client's IP address, but then the client programme would have to create and ServerSocketChannel object, bind it to some InetAddress and then... and then client becomes a server! - that breaks the idea of client-server cooperation and demands on players of my game to have routed some port on their machines. To resolve this problem I made some sort of "system" which, when some player/client is logging into my server, accepts second (this time constant, not "short") connection on the second port I mentoined on the beginning. This connection is held in variable "SocketChannel serverCon" of class "Player" - which reflects a player logged onto server. Server maintains every such connection till the client logs off. After the connection is accepted, the player whom connection it was is added to collection called "playersToRegisterToWrite". After the Selector.selectNow() is invoked (as You can see in the code below), each and every player's connection is registered in selector (with selection key - OP_WRITE and attachment pointing on owning player). In the same time client's code is trying to read some bytes from this connection and blocks on it until some bytes are written to this connection. When server wants to "tell" something to client, deliver some message/command, it creates a new instance of class which extends an abstract class called "ServerAction" (another new thread) and adds it to collection "actionsToDo". In ServerAction's method "run()" there are whole code to interact with client (e.g. send an update of players' list, an update of games' list, a chat message). Finnaly when Selector informs the server that some connection is writable (some client is waiting for commands), then server checks if there's any "actionToDo" involving this client/player. If there is, it unregisters the connection from Selector (so no other ServerAction (thread) can write on this connection) and starts the action. At the end of every "run()" method of subclass of ServerAction there's a code, which again adds the player to collection "playersToRegisterToWrite", so the player's connection can again be registered in Selector and the player can again receive informations from server - after it consumed THIS "ServerAction".
    It looks to me like it should be working fine, but it's not. When I test my server and clients on the same machine (no ping/latency) everything seems to be working fine. But when it comes to play my game with somebody even on LAN or through the Internet there comes the problems. My first socket I describe (and first type of connections - short connections) works perfectly fine, so the requests triggered by client are delivered and handled properly. But the second socket is cirppling. For example: the server triggers a command refering to an update of clients logged to server' list. It is triggered by Selector so the client should be ready to read data from server, so the server sends data! And the client never receives it... Why?
    It experimented a whole lot of time on SocketChannel's method "configureBlocking(boolean)", but it never helps. I think the client should always block it's listening thread on connection, contratry to server which is ment to be fast, so it should send the data through non-blocking channels. Am I right? Are there any rules refering blocking configuration of SocketChannels?
    I will be grateful for every answer. To help You out I attach also drafts from run()'s methods of my classes.
    Server's main method - main thread :
        public void run() {
           try {
                selector = Selector.open();
                clientConSsc.configureBlocking(false);
                clientConSsc.register(selector , SelectionKey.OP_ACCEPT);
                while(serverRunning) {
                    try {
                        selector.selectNow();
                        Iterator it;
                        synchronized(playersToRegisterToWrite) {
                            it = playersToRegisterToWrite.iterator();
                            while(it.hasNext()) {
                                Player player = (Player)it.next();
                                it.remove();
                                player.serverCon.configureBlocking(false);
                                player.serverCon.register(selector , SelectionKey.OP_WRITE , player);
                        Set keys = selector.selectedKeys() {
                        it = keys.iterator();
                        while(it.hasNext()) {
                            SelectionKey key = (SelectionKey)it.next();
                            if(key.isAcceptable()) {
                                it.remove();
                                clientCon = clientConSsc.accept();
                                clientCon.configureBlocking(false);
                                clientCon.register(selector , SelectionKey.OP_READ);
                                continue;
                            if(key.isReadable()) {
                                it.remove();
                                key.cancel();
                                new RequestHandler(this , (SocketChannel)key.channel()).start();
                                continue;
                            if(key.isWritable()) {
                                if(key.attachment() != null ) {
                                    ServerAction action = null;
                                    synchronized(actionsToDo) {
                                        Iterator aIt = actionsToDo.iterator();
                                        while(aIt.hasNext()) {
                                            ServerAction temp = (ServerAction)aIt.next();
                                            if(temp.getPlayer().equals((Player)key.attachment())) {
                                                action = temp;
                                                aIt.remove();
                                                break;
                                    if(action != null) {
                                        key.channel().configureBlocking(false);
                                        it.remove();
                                        key.cancel();
                                        action.start();
                                continue;
                    } catch(Exception e) {
                        statusArea.append(e.toString() + "\n");
                        e.printStackTrace();
                        continue;
            } catch(ClosedChannelException e) {
                statusArea.append(e.toString() + "\n");
            } catch(IOException e) {
                statusArea.append(e.toString() + "\n");
                A part of server's RequestHandler's class' method run() - the method which handles requests triggered by client on first port:
    public void run() {
            boolean served = false;
                try {
                    channel.configureBlocking(true);
                    retryCount++;
                    retry = false;
                    String command = ns.readText(channel).trim();
                    ns.statusArea.append("ktos przesyla komende: " + command + "\n");
                    if(command != null && !command.equals("ERROR")) {
                        String[] cmd = command.split("�");
                        ns.statusArea.append("komenda: " + cmd[0] + "\n");
                        if(cmd[0].equals("CHAT")) {
                            if(cmd.length != 5) {
                                retry();
                            } else {
                                if(cmd[2].equals("NOGAME")) {      // jezeli nie ma okreslonej gry czyli rozsylamy do wszystkich
                                    for(int i = 0 ; i < ns.loggedPlayersListItems.size() ; i++) {
                                        Player current = (Player)ns.loggedPlayersListItems.get(i);
                                        if(current.state == Player.CHOOSING && !current.equals(new Player(Integer.parseInt(cmd[1]))))   // jezeli gracz jest w okienku wybierania gry to wysylamy mu broadcast
                                            ns.actionsToDo.add(new SendMsg(ns , current , "CHAT�" + cmd[1] + "�" + cmd[3] + "�" + cmd[4]));
                                } else {
                                    Game game = (Game)ns.gamesListItems.get(ns.gamesListItems.indexOf(new Game(Integer.parseInt(cmd[2]))));
                                    for(int i = 0 ; i < game.players.size() ; i++) {
                                        Player current = (Player)game.players.get(i);
                                        if(!current.equals(new Player(Integer.parseInt(cmd[1]))))
                                            ns.actionsToDo.add(new SendMsg(ns , current , "CHAT�" + cmd[1] + "�" + cmd[3] + "�" + cmd[4]));
                                served = true;
                        } else if(cmd[0].equals("GETGAMEINFO")) {
                            if(cmd.length != 3)
                                retry();
                            else {
                                int gameID = Integer.parseInt(cmd[2]);
                                ns.statusArea.append("poproszono o informacje o grze nr: " + gameID + "\n");
                                Game checkedGame = new Game(gameID);
                                if(ns.gamesListItems.contains(checkedGame)) {
                                    Game game = (Game)ns.gamesListItems.get(ns.gamesListItems.indexOf(checkedGame));
                                    channel.configureBlocking(true);
                                    ObjectOutputStream oos = new ObjectOutputStream(channel.socket().getOutputStream());
                                    oos.writeObject(game);
                                    oos.writeObject(game.players);
                                    oos.flush();
                                    ns.statusArea.append("wyslano informacje o grze nr: " + gameID + "\n");
                                } else {
                                    ns.statusArea.append("brak gry o nr: " + gameID + "\n");
                                served = true;
                } catch(IOException e) {
                    e.printStackTrace();
            if(!served) {
                ns.findAndDisconnectPlayer(channel);
            try {
                channel.close();
            } catch(IOException e) {
                e.printStackTrace();
        }An example of ServerAction's subclass - the class which triggers server commands to client on second port:
    class UpdateLoggedPlayersList extends ServerAction {
        public UpdateLoggedPlayersList(NeuroServer ns , Player player) {
            super(ns , player);
        public void run() {
            try {
                serverCon.configureBlocking(true);
                ns.sendText("UPDATELOGGEDPLAYERSLIST" , serverCon);
                if(ns.readText(serverCon).equals("OK")) {
                    ObjectOutputStream oos = new ObjectOutputStream(serverCon.socket().getOutputStream());
                    oos.writeObject(ns.loggedPlayersListItems);
                    oos.flush();
                synchronized(ns.playersToRegisterToWrite) {
                     ns.playersToRegisterToWrite.add(player);
            } catch(IOException e) {
                e.printStackTrace();
    }A part of client's CmdHandler's class' method run() - the method which handles commands triggered by server:
    public void run() {
        try {
            while(works) {
                String command = nc.readText(nc.serverCon);
                System.out.println("Server przesyla komende: " + command + "\n");
                String[] cmd = command.split("�");
                if(cmd[0] != null && !cmd[0].equals("ERROR")) {
                    if(cmd[0].equals("CHAT")) {
                        if(nc.chooseGameDialog != null && nc.chooseGameDialog.isVisible()) {     // jezeli na wybieraniu gry
                            newChatEntry(cmd[2] , null , cmd[3] , nc.chooseGameDialog.chatPane);
                        } else if(nc.readyDialog != null && nc.readyDialog.isVisible()) {  // jesli na przygotowywaniu
                            Player sender = (Player)nc.actGame.players.get(nc.actGame.players.indexOf(new Player(Integer.parseInt(cmd[1]))));
                            newChatEntry(cmd[2] , sender.fraction , cmd[3] , nc.readyDialog.chatPane);
                        } else if(nc.ng != null) {                   // jesli w grze
                            Player sender = (Player)nc.actGame.players.get(nc.actGame.players.indexOf(new Player(Integer.parseInt(cmd[1]))));
                            newChatEntry(cmd[2] , sender.fraction , cmd[3] , nc.ng.inGameChatPane);
                    } else if(cmd[0].equals("UPDATELOGGEDPLAYERSLIST")) {
                        nc.sendText("OK" , nc.serverCon , false);
                        nc.serverCon.configureBlocking(true);
                        ObjectInputStream ois = new ObjectInputStream(nc.serverCon.socket().getInputStream());
                        DefaultListModel players = (DefaultListModel)ois.readObject();
                        nc.chooseGameDialog.updateLoggedPlayersList(players);
        } catch(IndexOutOfBoundsException e) {
            System.out.println(e);
        } catch(IOException e) {
            System.out.println(e);
        } catch(ClassNotFoundException e) {
            System.out.println(e);
    }And two methods I used in codes above: sendText(String text , SocketChannel sc) and readText(SocketChannel sc) - they are my "utility" methods, which I use to send and receive Strings through specified SocketChannels.
    boolean sendText(String text , SocketChannel sc) {
        ByteBuffer bbuf = ByteBuffer.allocate(BSIZE);
        boolean sendRetry;
        boolean sent = false;
        do {
            sendRetry = false;
            try {
                StringBuffer cmd = new StringBuffer();
                cmd.setLength(0);
                if(text.length()+4 < 100)
                    cmd.append("0");
                if(text.length()+4 < 10)
                    cmd.append("0");
                cmd.append(Integer.toString(text.length()+4) + "�");
                cmd.append(text);
                cmd.append("\n");
                bbuf = charset.encode(CharBuffer.wrap(cmd));
                sc.write(bbuf);
                bbuf.clear();
                int n = sc.read(bbuf);
                if(n == 1) {
                    bbuf.flip();
                    Byte re = bbuf.get();
                    if(re == 1) {
                        sendRetry = true;
                    } else {
                        sent = true;
            } catch(Exception e) {
                findAndDisconnectPlayer(sc);
                try {
                    sc.close();
                } catch(IOException f) {
                    f.printStackTrace();
                return false;
        } while(!sent && sendRetry);
        return true;
    String readText(SocketChannel sc) {
        ByteBuffer bbuf = ByteBuffer.allocate(BSIZE);
        int readRetryCount = -1;
        boolean readRetry;
        do {
            readRetry = false;
            readRetryCount++;
            StringBuffer cmd = new StringBuffer();
            cmd.setLength(0);
            bbuf.clear();
            try {
                readLoop:
                while(true) {
                    int n = sc.read(bbuf);
                    if(n > 0) {
                        bbuf.flip();
                        CharBuffer cbuf = charset.decode(bbuf);
                        while(cbuf.hasRemaining()) {
                            char c = cbuf.get();
                            if(c == '\r' || c == '\n') break readLoop;
                            cmd.append(c);
                    } else break;
                statusArea.append(Thread.currentThread().getId() + " readText() odczytuje: " + cmd.toString() + "\n");
                if(cmd.length() < 3 || Integer.parseInt(cmd.substring(0 , 3)) != cmd.length()) {
                    sc.write(ByteBuffer.wrap(new byte[] {1}));
                    readRetry = true;
                } else {
                    sc.write(ByteBuffer.wrap(new byte[] {0}));    // length OK
                    return cmd.toString().substring(4 , cmd.toString().length());
            } catch(Exception e) {
                findAndDisconnectPlayer(sc);
                try {
                    sc.close();
                } catch(IOException f) {
                    f.printStackTrace();
                return "ERROR";
        } while(readRetry && readRetryCount < 3);
        findAndDisconnectPlayer(sc);
        try {
            sc.close();
        } catch(IOException e) {
            e.printStackTrace();
        return "ERROR";
    }Edited by: Kakalec on Jul 23, 2008 11:04 AM

    You seem to be using a horrendous mixture of PrintWriters, BufferedReaders, ObjectOutputStreams, and no doubt ObjectInputStreams. You can't do that.
    Some rules about this:
    (a) Whenever you use a stream or reader or writer on a socket, you must allocate it once for the life of the socket, not every time you want to do an I/O.
    There are many reasons for this including losing buffered data in the old stream and auto-closure of the socket on garbage-collection of the old stream.
    (b) You can't mix stream types on the same socket. (i) If you're writing objects, use an ObjectOutputStream, you must read with an ObjectInputStream, and you can't read or write anything that isn't supported by the API of ObjectOutputStream. (ii) If you're writing lines, use a BufferedWriter and a BufferedReader at the other end. If you're writing characters, use a Writer and a Reader. (iii) If you're writing primitive data or UTF strings, use a DataOutputStream and a DataInputStream. (iv) If you're writing bytes, use DataOutputStream and a DataInputStream or an OutputStream and an InputStream. You can't mix (i), (ii), (iii), and (iv).
    (c) Don't use PrintWriter or PrintStream over the network. They swallow exceptions that you need to know about. They are for writing to the console, or log files, where you don't really care about exceptions.
    (d) Call flush() before reading.
    (e) Always close the 'outermost' output stream or writer of a socket, never the input stream or the socket itself. Closing any of these closes the socket and therefore makes the other stream unusable, but only closing the output stream/writer will flush it.

  • Trouble rationalizing use of multi-threading in run of the mill servlets

    Hey everybody,
    While spending time writing an internal wiki article on servlets for work, I asked myself a very basic question: What does multi-threading buy average servlets where the business logic requires procedural handling of the request?
    Don't get me wrong: I appreciate the fact that servlet containers spawning a new thread being less expensive than spawning an entirely new process is helpful and efficient. Coming from a background in PHP, it is great how servlets maintain persistence. However, as more of my coworkers are required to gain proficiency in Java and designing servlets, it is a question that many will ask and aside from having real-time processing of data files and other arduous tasks, I cannot think of any instances of where multi-threading benefits the application.
    What are some of the ways that you are using multi-threading with web applications?
    How would you explain why and where you would want to use multi-threading to someone?
    Thank you in advance for your insight,
    Andy

    how can we pass arguments to the run ()method?Create classes which implement Runnable that take your runtime parameters as constructor arguments and store them.
    eg: if your single thread method is   static void foo (int quantity, String name) {
        for (int i=0; i<quantity; i++) {
          System.out.println(name);
    // caller code
      foo(7, "wombats");Then you can make a runnable implementation thus:public class Foo implements Runnable {
      final int quantity_;
      final String name_;
      public Foo (int quantity, String name) {
        quantity_ = quantity;
        name_ = name;
      public void run () {
        for (int i=0; i<quantity_; i++) {
          System.out.println(name_);
    // caller code
      new Thread(new Foo(7, "wombats")).start();
    You could overload this method to take parameters in
    your class that implements the Runnable interface,
    and then call the base run() method.I don't get what you mean by this; Runnable is an interface so there is no base class run() method, and a run() overloaded with extra parameters method wouldn't get called by the thread.
    Pete

Maybe you are looking for

  • Link problem between PCs and Macs

    Hello.  We have 3 Macs running OSX 10.5.x and Adobe Std CS5, and they share their Illustrator creations, images, etc., on a NAS file server.  Recently, I downloaded the CS5.5. trial version for a PC running Windows XP Pro and on the same network with

  • How to create the item creation in the oracle apps what is the use with that

    hi friends please send ans to me for this with real time scenario

  • CK11N, not using PIR for material valuation.

    Hi, I am trying to run CK11N, material valuation for purchased part using PIR strategy. My valuation variant has the following strategy: 1. standard price. 2. price from purchase info record. and I've also configured the sub-strategy for #2 above. Th

  • No entry in table $ for key $ 554C 400100 20090

    Hi Gurus, While running payroll--for some employees(pre . number 125) the following error is coming: No entry in table $ for key $ 554C 400100 20090 Technical error no. 72 02.01.2009 Processing terminated for EE 00000125 This error is coming while I

  • Delimited, matrix, excel, reports6i,

    Hi Everybody! My question is very urgent and drawning out for a long. I would like to create matrix format delimited output reports calling the MS-Excel plug-in in the browser ( IE6 ). It's fine when I create report with a simple query ( the output o