Surprisingly fast locking of single thread

The question in this thread
http://forums.adobe.com/thread/1080275?tstart=0
was correctly answered within two minutes by Bill, and his answer was marked as correct and the thread locked, probably shortly after Bill's posting.
What I find susprising is that the Reader forum has hundreds of similar questions and answers (see Pat's complain here http://forums.adobe.com/thread/1079699?tstart=0) , but only a handful of them are marked as Answered. And, without checking, I would say that (almost) none of these threads have been locked.
Bill, was that you?

Locking dead-ended threads is one tool we can use to maintain an effective customer experience. Experts on the forum tend to ignore answered questions precisely because they're answered, so thread-hijackers have much less chance of getting help compared to when they post a new question. As Bill and John have said, if someone searches the forums for a keyword and hits one of the threads that were started in the wrong place we absolutely do not want them replying to it.
Locks are applied for three basic reasons:
The thread is in the wrong place and couldn't be moved due to lack of information (outright duplicate posts are removed when they're noticed - please report any you find).
The thread has deviated from the original topic or has violated the Guidelines (e.g. it's descended into a slanging match).
The post is for information only (e.g. FAQ pages).
If there is an active and pertinent conversation within a thread it won't be locked, even if a Correct reply has been selected, but there are some threads which are so old or so trivial there's no reason anyone should reply to them. These forums are used for internal reporting and it assists with that process to have a number of similar-but-separate questions in the database as opposed to one thread with several conversations crossing each other.
There are some forums which are read-only, e.g.  legacy or beta versions of software, but there will always be a new and open forum for current issues if the product still exists.
Current policy is for hosts to assign a Correct status to answers as and when they are identified, allowing time for the OP to make the decision first. Historically we didn't do this so there are hundreds of thousands of old threads which are 'answered' but not marked as such. It's a very long process to go through and retag them - and there's little benefit from doing so.

Similar Messages

  • DB need too many locks in single threaded application

    Hello,
    I`m new to BDB, and search for help of gurus.
    I try to create database importing data from csv files. Import procedure is already written and works fine, but sometimes it starts to need too many locks.
    Import process read csv file line by line. Check if key is already in the database, if yes it updates data, otherwise create new record. Import procedure is using DBEnv and transaction.
    Please, look at 2 cases of data to import.
    Case 1: Data in csv files are like:
    key1, some_data_1
    key1, some_data_2
    key2, some_data_3
    key2, some_data_4
    keyN, some_data_2N-1
    keyN, some_data_2N
    (key became a key and data became the value in the database)
    Case 2: Remove each second line in the csv file, so it became:
    key1, some_data_1
    key2, some_data_3
    keyN, some_data_2N-1
    In this case for successful import of the file more locks are needed then in case 1.
    This seems very odd to me. Could somebody explain why lock system behave so? Looking forward to hearing any response.
    Thanks.
    p.s.: maybe my explanation is not very clear, but i don't know which other details are really important. I could provide more details if it could help.
    Message was edited by:
    user647892

    There is nothing wrong.
    Oracle by default locks records. In case 1, you insert a record (1 row level lock) and update that same record. Why is a mystery, but the update doesn't require a lock (by you) as you already did lock the record.
    In case 2, you have distinct keys for each line, so each line results in a row level lock as expected.
    There are as much record locks as you request it to make.
    You could consider locking the table explicitly once, prior to the transaction, by a lock table statement.
    However, your approach is fundamentally flawed an non-scalable, as it processes each line individually instead of loading the data in a staging table and transferring it to the production table using
    insert into production table
    select * from staging table
    where key not in (select key from product table)
    Sybrand Bakker
    Senior Oracle DBA

  • Fast Lock

    I would like to have fast locks as Win32's InterlockedIncrement().
    Currently I am using the swap assembler instruction. Is this correct or do I need to add a kind of memory barrier?
    I would rather like to use the atomic_add function family but it doesn't seem to be available for user programs.
    Does any have a suggestion in order to have fast locks?

    One thread is enough however
    Try performing a system repair using PC Companion as this will often fix issues - This will factory reset your phone and erase all data so best to backup before you begin
    Switch off your phone and unplug from Pc (Hold volume up and power for around 10 seconds)
    Start PC Companion and select Support zone then Update my phone/tablet then in Blue Repair my phone/tablet and follow the on screen instructions - When prompted connect your phone still switched off holding volume down or back button - This should start the repair or reformat process
    If you are using Windows 8/8.1 or a 64bit operating system then adjust the settings for PC Companion and run in compatibility mode and chose Windows 7 or XP

  • Is addIndex() call single threaded ?

    Hey guys
    I have a question on Coherence indexing, I hope you can clarify.
    Currently, our indexing process takes up to 60 minutes to create indexes for 500K entries on one cache.
    It is a XML cache, and uses reflection extractor to extract XPath attribute to create index.
    Priming cache is a two step process: first, we finish priming the cache; second, we start adding indexes.
    60 minutes is too long, so we wrote a quick code to test whether adding index in parallel (using processing nodes) would reduce overall creation time.
    But, it made no difference. It is still taking 60 mins.
    Does that mean addIndex() call will lock the entry whilst it is being indexed, which makes other threads to wait for its turn ?
    I checked all documentation, could not find any answers. Any tips will be a big help.
    Note:
    - Business definitely wants to keep XML cache and index the attributes based on XPATH.
    Thanks
    Kannan

    Hey JK
    Thanks for your reply. Yeap you are right, I tried to explain them (Client) to move away from XML store but it was a no go. It is a bad design. Hence this approach.
    I did few tests yesterday, it proved that addIndex call is a single threaded and it uses one member node at a time (I profiled the JVM). However, when I tried to addIndex before priming the cache, the results are better.
    The cache service uses all storage nodes to update indexes in parallel. It does reduces overall indexing time.
    We have 16 indexes to create, average size of XML (compressed using zLib) is 10KB (but there are big files upto 70KB) and there are 500K entries. In total 16 storage nodes (3.5 G heap each) split by 2 physical machines in dev environment.
    I agree, everytime an index needs to be created or updated, the process needs to deserialize xml and extract the XPATH, add it to SimpleMapIndex. After that, the objects is ready for collection, which (as you said) causes lot of GC (CPU hits 100% most of the time).
    Given that I cannot change XML store and XPath based index, I have few options to tune with:
    1. Tune GC
    2. Use fast xml processing libraries
    3. Use LZ4 compression rather than Zlib.
    Thanks
    Kannan

  • RE: DBSessions and Single-threading

    Thanks Linh. Always good to here from you.
    thanks
    ka
    Kamran Amin
    Forte Technical Leader, Core Systems
    (203)-459-7362 or 8-204-7362 - Trumbull
    [email protected]
    From: Linh Pham[SMTP:[email protected]]
    Sent: Friday, November 13, 1998 2:51 PM
    To: Ajith Kallambella M; [email protected]; ForteUsers;
    [email protected]
    Subject: RE: DBSessions and Single-threading
    all,
    This information (technote draft # 11716) is to clear up the confusion
    regarding
    database access.
    Note, Forte reserves the right to change this implementation in the
    future.
    Currently, there are two flavors of database access available with forte
    (as of version 30j1):
    1. single-threading access to all databases on all UNIX & VMS platforms
    2. multithreading access to all supported database except Sybase on
    intel/alpha-NT,
    and to a certain extent, limited support with SQLServer (see more
    details below)
    1. single-threading access:
    with this type of access, when the following code is executed
    (SQL select ... on MyDBSession;), forte locks the partition and
    all EXTERNAL requests will be queued. However, task switching inside
    the partition continues until the called task enters the DBVendor's
    API (as with any 3GL call). Prior to this moment, you can still have
    multiple tasks running inside the partition. As the called task
    enters the 3GL, it truly blocks a partition, ie. it's OUT there
    talking to the database and not communicating with the
    the forte's environment. If the query is long, the partition might not
    be
    able to acknowledge the environment manager's ping, and thus, will be
    deemed NOT reachable, and a new partition will be started (see technote
    11147). Another problem arises when you have multiple INTERNAL tasks
    trying to perform database access concurrently on the same DBSession.
    Since the behavior is unpredictable, we RECOMMEND that you only
    have ONE task at any time accessing the DBSession inside a partition.
    Please see also technote 7104 for more information regarding DBSession
    sharing & blocking.
    2. multi-threading access:
    on NT, we have added code to allow multithreading access to most
    supported
    database. What does this mean?
    a. when a task access the database, the partition will NOT be blocked.
    b. you can have multiple DBSessions inside a partition and allow
    concurrent access; however, we still RECOMMEND that you
    only have ONE task accessing a DBSession at any one time.
    Please consult a Forte consultant or a TSR in reference to technote
    11151 (only available internally). Please do NOT call Forte Technical
    Support for this technote.
    As to SQLServer, the ODBC driver that you use to access the database
    will
    determine if it's is reentrant or not. There is also a known problem
    with
    the Microsoft ODBC driver which causes the cursor state to become
    invalid when
    multiple tasks accessing the same session. Due to these problems, forte
    recommends that you single-threading access to SQLServer; otherwise
    use at YOUR OWN RISK.
    Hope this helps. IF you have questions regarding multithreading access
    support
    in the future, please contact a Forte Sales Rep or TSR.
    linh ...
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of Ajith Kallambella M
    Sent: Friday, November 13, 1998 9:08 AM
    To: [email protected]; ForteUsers; [email protected]
    Subject: RE: DBSessions and Single-threading
    Though, the DBSession partitions can reside on a
    thread-safe
    OS ( like NT ), the DBSession is still single threaded
    and your
    partition gets blocked for the duration of the DB
    access. Same
    is true, even if you have multi-threaded databases.
    Forte has not changed DBSession to make it
    multi-threaded.
    Infact, given the current implementation, the only way
    to simulate
    concurrent database access is to replicate the
    partition which
    has DBSession object. The famous DBEntityManagerPattern
    does essentially the same.
    I think we should all feel happy with this now, and
    hope for
    something better in 4.0.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation
    -----Original Message-----
    From: Eric Pereira [<a href=
    "mailto:[email protected]">mailto:[email protected]</a>]
    Sent: Friday, November 13, 1998 9:54 AM
    To: [email protected]
    Cc: [email protected]
    Subject: RE: DBSessions and Single-threading
    Kamran,
    That's not entirely correct. Partitions which access
    multi-threaded
    databases (like MS SQL Server on NT) do not block.
    There was some
    discussion about this over the User Group a while back
    - with no real
    conclusion, so perhaps Forte might want to step in and
    clarify.
    What I'm curious about is the outcome in a situation
    where one DB
    Session accesses SQL Server and another one talks to a
    non
    multi-threaded database within the same partition.
    Thanks.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Amin, Kamran" <[email protected]>
    To: [email protected], Peter Kelly
    <[email protected]>
    Subject: RE: DBSessions and Single-threading
    Date: Fri, 13 Nov 1998 07:52:09 -0500
    Reply-To: "Amin, Kamran" <[email protected]>
    Peter,
    If one of the service object is being used the that
    partition gets
    blocked until it has finished the request to the
    dbsession. It will not
    mater if the service objects are connected to different
    database. Using
    a
    dbsession makes the partition single threaded and
    that's why we use load
    balancing. Please look at tech. note 10647 for more
    info.
    ka
    Kamran Amin
    Forte Technical Leader, Core Systems
    (203)-459-7362 or 8-204-7362 - Trumbull
    [email protected]
    From: Peter Kelly[SMTP:[email protected]]
    Sent: Friday, November 13, 1998 6:27 AM
    To: [email protected]
    Subject: DBSessions and Single-threading
    Does a DBSession executing in a partition cause thatpartition to
    become
    single-threaded?
    Suppose a partition has 2 Service Objects.
    Each Service Object has its own unique DBSession.
    While a method in one Service Object is using itsDBSession,
    do all other threads in that partition halt and thenresume
    when the work with the first DBSession is complete.
    What if the two DBSessions are connected to differentdatabases,
    does this change anything?
    I heard rumours that Oracle on NT supportedmulti-tasking and blocking
    would not occur. If blocking does occur, is it aForte or Oracle
    limitation?
    Any input/comments appreciated.
    thanks,
    Peter
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >>
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

    Thanks Linh. Always good to here from you.
    thanks
    ka
    Kamran Amin
    Forte Technical Leader, Core Systems
    (203)-459-7362 or 8-204-7362 - Trumbull
    [email protected]
    From: Linh Pham[SMTP:[email protected]]
    Sent: Friday, November 13, 1998 2:51 PM
    To: Ajith Kallambella M; [email protected]; ForteUsers;
    [email protected]
    Subject: RE: DBSessions and Single-threading
    all,
    This information (technote draft # 11716) is to clear up the confusion
    regarding
    database access.
    Note, Forte reserves the right to change this implementation in the
    future.
    Currently, there are two flavors of database access available with forte
    (as of version 30j1):
    1. single-threading access to all databases on all UNIX & VMS platforms
    2. multithreading access to all supported database except Sybase on
    intel/alpha-NT,
    and to a certain extent, limited support with SQLServer (see more
    details below)
    1. single-threading access:
    with this type of access, when the following code is executed
    (SQL select ... on MyDBSession;), forte locks the partition and
    all EXTERNAL requests will be queued. However, task switching inside
    the partition continues until the called task enters the DBVendor's
    API (as with any 3GL call). Prior to this moment, you can still have
    multiple tasks running inside the partition. As the called task
    enters the 3GL, it truly blocks a partition, ie. it's OUT there
    talking to the database and not communicating with the
    the forte's environment. If the query is long, the partition might not
    be
    able to acknowledge the environment manager's ping, and thus, will be
    deemed NOT reachable, and a new partition will be started (see technote
    11147). Another problem arises when you have multiple INTERNAL tasks
    trying to perform database access concurrently on the same DBSession.
    Since the behavior is unpredictable, we RECOMMEND that you only
    have ONE task at any time accessing the DBSession inside a partition.
    Please see also technote 7104 for more information regarding DBSession
    sharing & blocking.
    2. multi-threading access:
    on NT, we have added code to allow multithreading access to most
    supported
    database. What does this mean?
    a. when a task access the database, the partition will NOT be blocked.
    b. you can have multiple DBSessions inside a partition and allow
    concurrent access; however, we still RECOMMEND that you
    only have ONE task accessing a DBSession at any one time.
    Please consult a Forte consultant or a TSR in reference to technote
    11151 (only available internally). Please do NOT call Forte Technical
    Support for this technote.
    As to SQLServer, the ODBC driver that you use to access the database
    will
    determine if it's is reentrant or not. There is also a known problem
    with
    the Microsoft ODBC driver which causes the cursor state to become
    invalid when
    multiple tasks accessing the same session. Due to these problems, forte
    recommends that you single-threading access to SQLServer; otherwise
    use at YOUR OWN RISK.
    Hope this helps. IF you have questions regarding multithreading access
    support
    in the future, please contact a Forte Sales Rep or TSR.
    linh ...
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of Ajith Kallambella M
    Sent: Friday, November 13, 1998 9:08 AM
    To: [email protected]; ForteUsers; [email protected]
    Subject: RE: DBSessions and Single-threading
    Though, the DBSession partitions can reside on a
    thread-safe
    OS ( like NT ), the DBSession is still single threaded
    and your
    partition gets blocked for the duration of the DB
    access. Same
    is true, even if you have multi-threaded databases.
    Forte has not changed DBSession to make it
    multi-threaded.
    Infact, given the current implementation, the only way
    to simulate
    concurrent database access is to replicate the
    partition which
    has DBSession object. The famous DBEntityManagerPattern
    does essentially the same.
    I think we should all feel happy with this now, and
    hope for
    something better in 4.0.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation
    -----Original Message-----
    From: Eric Pereira [<a href=
    "mailto:[email protected]">mailto:[email protected]</a>]
    Sent: Friday, November 13, 1998 9:54 AM
    To: [email protected]
    Cc: [email protected]
    Subject: RE: DBSessions and Single-threading
    Kamran,
    That's not entirely correct. Partitions which access
    multi-threaded
    databases (like MS SQL Server on NT) do not block.
    There was some
    discussion about this over the User Group a while back
    - with no real
    conclusion, so perhaps Forte might want to step in and
    clarify.
    What I'm curious about is the outcome in a situation
    where one DB
    Session accesses SQL Server and another one talks to a
    non
    multi-threaded database within the same partition.
    Thanks.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Amin, Kamran" <[email protected]>
    To: [email protected], Peter Kelly
    <[email protected]>
    Subject: RE: DBSessions and Single-threading
    Date: Fri, 13 Nov 1998 07:52:09 -0500
    Reply-To: "Amin, Kamran" <[email protected]>
    Peter,
    If one of the service object is being used the that
    partition gets
    blocked until it has finished the request to the
    dbsession. It will not
    mater if the service objects are connected to different
    database. Using
    a
    dbsession makes the partition single threaded and
    that's why we use load
    balancing. Please look at tech. note 10647 for more
    info.
    ka
    Kamran Amin
    Forte Technical Leader, Core Systems
    (203)-459-7362 or 8-204-7362 - Trumbull
    [email protected]
    From: Peter Kelly[SMTP:[email protected]]
    Sent: Friday, November 13, 1998 6:27 AM
    To: [email protected]
    Subject: DBSessions and Single-threading
    Does a DBSession executing in a partition cause thatpartition to
    become
    single-threaded?
    Suppose a partition has 2 Service Objects.
    Each Service Object has its own unique DBSession.
    While a method in one Service Object is using itsDBSession,
    do all other threads in that partition halt and thenresume
    when the work with the first DBSession is complete.
    What if the two DBSessions are connected to differentdatabases,
    does this change anything?
    I heard rumours that Oracle on NT supportedmulti-tasking and blocking
    would not occur. If blocking does occur, is it aForte or Oracle
    limitation?
    Any input/comments appreciated.
    thanks,
    Peter
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >>
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >>
    >
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • Waiting for a mouse click in a single thread

    Here's my problem:
    I'm working on a program I didn't initially create, and I picked it up from the rough midpoint of its evolution. It is a single thread AWT program, with a mouseListener interface already implemented.
    Here's my problem. In a game setting, we have two players. It is no problem when both are computer controlled. When player one is controlled by a human, I need to wait for a mouse event before returning, because upon returning player two moves (regardless of its player configuration).
    I can't do any kind of busy waiting because it is a single thread. I'm looking for some kind of option besides making the program multithreaded. This also makes it difficult to use some sort of boolean variable, though I don't think it's impossible.
    Thanks in advance for any help.
    Eric

    #9 - You are correct in your assumptions. I agree it's
    not the best model, but it worked for the original
    purpose, which was to have one player always
    controlled by the computer, and the option of
    selecting a second player as being either human or
    computer. Since each move is made manually - that is,
    for a move to be made, it requires user input - there
    was no harm in returning from a function, because it
    had no immediate computation. The requirements have
    just changed, and now I must allow both players to be
    selectable. This presents a problem in that I have to
    wait for the move actions to finish before
    proceeding.Understood.
    >
    My only question is, how can I access the AWT thread?You mentioned in an earlier post that you have action listeners. As triggered by user events, these are always called on the AWT thread. For example:
    import javax.swing.*;
    import javax.awt.event.*;
    JButton button = new JButton( new AbstractAction {
            public void actionPerformed(ActionEvent e) {
                synchronized (myMonitor) {
                    myMonitor.notifyAll();
        });This button can be added to some swing UI. If clicked on, then actionPerformed will be called on the AWT thread, and any threads waiting on myMonitor will be notified.
    I see what you are saying - it's almost exactly what
    my coworkers told me - but I don't have the knowledge
    to implement it, which is why I'm here. Creating a
    monitor object isn't a problem (makeMove() would need
    to be synchronized, otherwise you wouldn't be able to
    call wait()),I recommend using a separate object for the monitor, especially if you are already using synchronized, so that you know exactly how each object's lock is being used. If you're sure it is safe, then there is nothing wrong with using the object itself as the monitor, as you suggest, however.
    but I'm not sure what you mean by the
    action handling method should be called on the AWT
    thread.Just that any action listener method is always called on the AWT thread in response to user action.
    Dave

  • Locking a non-thread-safe DLL, innovative solutions?

    Hi,
    I need to be able to lock access to a non-thread-safe third party DLL, so that multiple threads cannot access DLL simultaneously. I know that I can use semaphore or a single element queue. Are there any other innovative solutions that would limit the access to the DLL to a single call simultaneously.
    If I use either semaphores or single element queue and use the semaphore (queue) with the same name in multiple programs (independent VIs), will the access to the DLL be handled without problems i.e. no collisions can happen? What if I build multiple applications (.exe) or application libraries (.dll), does a single semaphore (queue) still work between different applications or do they need to be initiated from the same application?
    Tomi
    Message Edited by Tomi M on 03-06-2006 08:01 PM
    Tomi Maila

    Tomi M wrote:
    One more thing, with
    innovative solutions I meant something like the following. Is there a
    way to use some properties of Labview execution system to automatically
    restrict the access to the DLL i.e. allow only single thread with
    certain properties to call the DLL while all other threads with the
    same properties are waiting in the execution queue. So if I set the
    execution priority to something specific and execution system to
    another something specific, will Labview thisway restrict access to DLL
    to be sequential?
    The proper way to
    call non multithread safe DLLs in LabVIEW is to configure the Call
    Library Node in the configuration dialog to be NOT reentrant. This
    tells LabVIEW that the DLL may behave badly or at least you do not want
    LabVIEW to call the DLL just from any thread. LabVIEW then will call
    this DLL function from the UI execution system which is guaranteed to
    only have one single thread at all times and therefore protect your DLL
    from being called frm different threads at the same time.
    Rlf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Is rendering in Final Cut single thread or multi thread?

    There seems to be this recurring message about how the new Macpros perform single-threaded tasks about the same as the previous gen of Macpros, however in multi-threaded tasks the new Pros shine.
    How do I know if a task is single-threaded or multi-threaded? I do a lot of rendering video filters, generators, effects, etc. in Final Cut. Even something as (seemingly) simple as generating scrolling credits takes forever to render.
    Is video rendering a multi-threaded task? Will I see time significant time savings in rendering with the new Pro machines?

    It's not right now but the new Mac Pros are faster in single-threaded modes anyway:
    http://www.macrumors.com/2009/03/14/updated-mac-pro-benchmarks-and-video-of-inte rnals/
    Turns out the initial benchmarks were incorrect. The integrated memory controller is a MASSIVE performance boost. But it is inevitable that Apple will eventually choose the multi-threaded route for Final Cut Studio anyway, even if they do not at the present.

  • I have a doubt about The Single-Thread Rule

    The [url http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html#rule]Single Thread Rule states:
    Rule: Once a Swing component has been realized, all code that might affect or depend on the state of that component should be executed in the event-dispatching thread.
    I began to wonder about this because so much code seems to work just fine when it isn't executed in the event dispatching thread. Why are there exceptions? I went looking for some code which acted differently when executed on the event thread than when it was not. I found this
    http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725
    Now I started wondering why this was the case. What I found was that DefaultCaret adds a document listener to the document of the JTextComponent. In this listener, the insertUpdate() method specifically tests if it is running on the event dispatch thread and if it is, it updates the caret position.public void insertUpdate(DocumentEvent e) {
        if (async || SwingUtilities.isEventDispatchThread()) {
            // ... update the caret position ...
    }I then copied the code from DefaultCaret and made a MyCaret. I needed to tweek the code a little bit, but it ran. I removed the event thread test. It worked outside the event thread. There was a small difference in the results though. The textarea did not scroll all the way to the bottom. Almost, but not quite. I didn't test enough to make sure this was the only problem, but there was at least one problem.
    Now I started think about why this would be. The thought crossed my mind that the order of the events which were posted to the event queue were probably important. Sun found bugs when components were updated out of the event thread, so they essentially ignored events which weren't on the event thread and created the The Single-Thread Rule.
    A few days pass. I'm starting to wonder if Sun could have done a better job making Swing components thread safe. I also don't know that this specific case I found was the rule or the exception to the rule. But without insight into the design philosopy of Swing, I would have to examine all their components and see how they have written them and see if I can come up with a better design. That sound like a lot of work. Especially without getting paid for it.
    But wait a second, all you have to do is call the append() method of JTextArea on the event thread. If that is the case, why didn't they write the freakin component that way? Well, I'll try itclass MyTextArea extends JTextArea {
      public MyTextArea(int rows, int columns) { super(rows,columns); }
      public void append(final String text) {
        if (SwingUtilities.isEventDispatchThread()) super.append(text);
        else {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() { myAppend(text); }
      private void myAppend(String text) { super.append(text); }
    }I change [url http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725]camickr's code to use a MyTextArea and it works fine without calling from the event thread. I've essentially moved The Single-Thread Rule to the component itself rather than relying on each and every one of the [url http://www.aboutlegacycoding.com/default.htm?AURL=%2FSurveys%2FSurvey6intro%2Easp]2.5 million Java programmers worldwide to use SwingUtilities.invaokeLater().
    Now for my question...
    Why didn't Sun do this?

    Swing is slow enough as it is. Lets not make it slower
    just
    because dense "programmers" don't know what they are
    doing.I agree with you in defending the current model, but aren't you a bit harsh there?!? ;-)
    Well, there are a number of not-so-dense programmers that expect such high-level components to be thread-safe. The question is worth asking whether Sun intentionally favor the explicit thread management for performance reasons, or whether this was an oversight.
    I'd go for the former (intentional) : indeed any GUI toolkit is inherently thread-based; there is always a distinction between the graphical thread(s) and the application threads - and the programmer always has to manage explicit thread creation to handle long-running event handlers without blocking the event dispatching thread. Extending thread concerns to the updating of components is therefore not a big move.
    So it seems fair that a core GUI toolkit does not hide thread issues (though to the best of my knowledge there is no such limitation in updating AWT components), or at least that's what Sun deemed.
    An ease-of-use-focused toolkit wrapping the core toolkit for thread-safety can be provided as a third-party product. Though I agree that wrapping the dozens of existing widgets and hundreds of methods is cumbersome - and the lack of such products probably shows it would have a low added value to trained developpers.
    Because your way is an extra method call and if
    statement, neither of which is necessary if you already know you
    are in the correct thread. Now count the number of methods
    which will need to be changed (and add up the extra cost).Indeed it's quite common to update several properties of several widgets in one bulk (when user clicks "OK", add a row to the table, change the title of the window, update status bar, re-enable all buttons, change some color,...).
    In this case explicit thread management doesn't spare one if but a dozen of redundant ifs!
    Note that there could have been if-less ways to cope for thread safety, such as creating a copy of the component's model when a change is made to a component, and switching the model only before paint() is called in the event-dispatching - of course coalescing all changes into the same "updated" model until paint() is called.
    But this would trade ease of use for redundant memory consumption, especially for some components with potentially huge models (JTree, JTable, JTextArea,...). And Swing appears to be already quite memory-greedy!

  • Thread: Could not generate the XML in single thread mode

    Hi all,
    I have created a report using PLSQL Procedure method after submitting the request I am getting the following Error.Couldn't sort out why I am getting the error while running the report.
    Error in "Multi threaded or single threaded execution block" of XXRX_REPORT_OUTPUT_PKG.insert_into_nested_table procedure
    ERROR :ORA-20005: Could not generate the XML in single thread mode
    XXRXERROR: XXRX_REPORT_OUTPUT_PKG.run_report SQLERROR: ORA-20005: ORA-20005: Could not generate the XML in single thread mode
    Can someone help me out finding the issue
    Thanks in Advance

    Hi,
    Please read SQL and PL/SQL FAQ
    We cannot guess what is the error if you don't post any part of your code.
    Additionally when you put some code or output please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help! My application uses a Single Thread !

    Hi all !
    I have a web application which performs some long running tasks. This can be easily simulated with:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              System.out.println("Started Long Running Task!");
              try {
                   Thread.sleep(20000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("Done");
    In order to deal with Long Running Tasks, I have created a WorkManager with MinThreads 10 and MaxThreads 100
    Then I have assigned the Work Manager to the Web application usign weblogic.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
    <wl-dispatch-policy>WorkManager-0</wl-dispatch-policy>
    </weblogic-web-app>
    However it seems that the Web application uses a SINGLE Thread to reply to the Servlet. In other words issuing n parallel requests the output is:
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    My settings are the default Weblogic 12c Server settings, I've just added Weblogic NIO performance libs to the Java's path.
    Is there any setting which allow just 1 Socket for my application ? Maybe it's because I'm using the "unlicensed" (free download) server version ?
    Thanks a lot
    Frank

    You need to create separate Windows user accounts if you want to seperate the behaviour of iTunes for each user. That also means separate iTunes libraries for each user.
    Windows is a multi-user operating system but you are not using it properly. iTunes is not a multi-user application. No application is. You can't expect it to treat different users differently when they are all using the same computer user account.
    Do you understand what I mean?

  • DBMS_PARALLEL_EXECUTE multiple threads taking more time than single thread

    I am trying to insert 10 million records from source table to target table.
    Number of chunks = 100
    There are two scenarios:
    dbms_parallel_execute(..... parallel_level => 1) -- for single thread
    dbms_parallel_execute(..... parallel_level => 10) -- for 10 threads
    I observe that the average time taken by 10 threads to process each chunk is 10 times the average time taken in case of single thread.
    Ideally it should be same which would reduce the time taken by a factor of 10 (due to 10 threads).
    Due to the above mentioned behavior, the time taken is the same in both cases.
    It would be great if anybody can explain me the reason behind such behavior.
    Thanks in advance

    Source Table = TEST_SOURCE
    Target Table = TEST_TARGET
    Both tables have 100 columns
    Below is the code:
    DECLARE
    l_task VARCHAR2(30) := 'test_task_F';
    l_sql_stmt VARCHAR2(32767);
    l_try NUMBER;
    l_stmt VARCHAR2(32767);
    l_status NUMBER;
    BEGIN
    l_stmt := 'select dbms_rowid.rowid_create( 1, data_object_id, lo_fno, lo_block, 0 ) min_rid,
                                       dbms_rowid.rowid_create( 1, data_object_id, hi_fno, hi_block, 10000 ) max_rid
                                       from (
                                       select distinct grp,
                                  first_value(relative_fno)
                                  over (partition by grp order by relative_fno, block_id
                                  rows between unbounded preceding and unbounded following) lo_fno,
                                  first_value(block_id )
                                  over (partition by grp order by relative_fno, block_id
                                  rows between unbounded preceding and unbounded following) lo_block,
                                  last_value(relative_fno)
                                  over (partition by grp order by relative_fno, block_id
                                  rows between unbounded preceding and unbounded following) hi_fno,
                                  last_value(block_id+blocks-1)
                                  over (partition by grp order by relative_fno, block_id
                                  rows between unbounded preceding and unbounded following) hi_block,
                                  sum(blocks) over (partition by grp) sum_blocks
                                  from (
                                  select relative_fno,
                                  block_id,
                                  blocks,
                                  trunc( (sum(blocks) over (order by relative_fno, block_id)-0.01) / (sum(blocks) over ()/100) ) grp
                                  from dba_extents
                                  where segment_name = upper(''TEST_REGION_SOURCE'')
                                  and owner = ''FUSION'' order by block_id
                             (select data_object_id from user_objects where object_name = upper(''TEST_REGION_SOURCE'') )';
    DBMS_PARALLEL_EXECUTE.create_task (task_name => l_task);
    DBMS_PARALLEL_EXECUTE.create_chunks_by_sql(task_name => l_task,
    sql_stmt => l_stmt,
    by_rowid => true);
    l_sql_stmt := 'insert into FUSION.TEST_REGION_TARGET(REGION_ID,REGION1,REGION2,REGION3,REGION4,
                             ...., REGION99
                             SELECT REGION_ID,REGION1,REGION2,REGION3,REGION4,
                             .....,REGION99
                             from FUSION.TEST_REGION_SOURCE WHERE (1=1) AND rowid BETWEEN :start_id AND :end_id ';
    DBMS_PARALLEL_EXECUTE.run_task(task_name => l_task,
    sql_stmt => l_sql_stmt,
    language_flag => DBMS_SQL.NATIVE,
    parallel_level => 10);
    -- If there is error, RESUME it for at most 2 times.
    l_try := 0;
    l_status := DBMS_PARALLEL_EXECUTE.task_status(l_task);
    WHILE(l_try < 2 and l_status != DBMS_PARALLEL_EXECUTE.FINISHED)
    Loop
    l_try := l_try + 1;
    DBMS_PARALLEL_EXECUTE.resume_task(l_task);
    l_status := DBMS_PARALLEL_EXECUTE.task_status(l_task);
    END LOOP;
    DBMS_PARALLEL_EXECUTE.drop_task(l_task);
    END;
    Edited by: 943978 on Jul 2, 2012 9:22 AM

  • The Coded Ui Test Method is runnung in Single Thread Apartment(STA) Mode of COM

    Hi,
    when running tests with CUIT,and after a timeout in the previous tests we noticed the following error:
    lass Initialization method TestSuite2.MyClassInitialize threw exception. Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: The Coded UI Test is running in Single Thread Apartment (STA) mode of COM. In this mode, all the playback calls should happen from the TestMethod thread only and UITestControl should not be shared across TestMethods..
    Stack Trace:
    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.ThrowExceptionIfCrossThreadAccess(IScreenElement uiElement)
    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.InitPlayback()
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()
    at RapArtTest.Tests.Generic.GenericTestsTemplate.ClassInit(TestContext context)
    at TestSuite2.MyClassInitialize(TestContext context)Please note that we get this error if we have 10 tests failing with a timeout issue previously, after that all our tests suite fail with the same STA error.is there a way to workaround this ?

    Hi kaki2000,
    >>Please note that we get this error if we have 10 tests failing with a timeout issue previously.
    Which VS IDE did you use, VS2010 or high version?
    Do you run your coded UI tests in VS IDE or you add them to a load test? If you run your coded UI tests one by one in VS IDE, how about the result?
    >>The Coded UI Test is running in Single Thread Apartment (STA) mode of COM.  In this mode, all the playback calls should happen from the TestMethod thread only and UITestControl should not be shared across TestMethods..
    After a test method is finished, please call the clean playback. Then the later test method can reload UIMap and find exactly one on testing.
    Reference:
    http://blog.csdn.net/marryshi/article/details/8815025
    https://social.msdn.microsoft.com/Forums/en-US/ea5a2bd0-dbae-4256-b8c3-25d6eb45257a/codedui-single-thread-apartment-sta-mode-of-com-issue?forum=vsautotest
    In addition, do not call UI actions from the ClassCleanup method.
    Reference:
    http://stackoverflow.com/questions/16667350/coded-ui-test-single-thread-apartment-sta-error-occurred-while-executing-clas
    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft does not control these sites and has not tested any software or information found on these sites;
    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to improve spreadsheet speed when single-threaded VBA is the bottleneck.

    My brother works with massive Excel spreadsheets and needs to speed them up. Gigabytes in size and often with a million rows and many sheets within the workbook. He's already refined the sheets to take advantage of Excel's multi-thread recalculation and
    seen significant improvements, but he's hit a stumbling block. He uses extensive VBA code to aid clarity, but the VB engine is single-threaded, and these relatively simple functions can be called millions of times. Some functions are trivial (e.g. conversion
    functions) and just for clarity and easily unwound (at the expense of clarity), some could be unwound but that would make the spreadsheets much more complex, and others could not be unwound. 
    He's aware of http://www.analystcave.com/excel-vba-multithreading-tool/ and similar tools but they don't help as the granularity is insufficiently fine. 
    So what can he do? A search shows requests for multi-threaded VBA going back over a decade.
    qts

    Hi,
    >> The VB engine is single-threaded, and these relatively simple functions can be called millions of times.
    The Office Object Model is
    Single-Threaded Apartments, if the performance bottleneck is the Excel Object Model operation, the multiple-thread will not improve the performance significantly.
    >> How to improve spreadsheet speed when single-threaded VBA is the bottleneck.
    The performance optimization should be based on the business. Since I’m not familiar with your business, so I can only give you some general suggestions from the technical perspective. According to your description, the size of the spreadsheet had reached
    Gigabytes and data volume is about 1 million rows. If so, I will suggest you storing the data to SQL Server and then use the analysis tools (e.g. Power Pivot).
    Create a memory-efficient Data Model using Excel 2013
    and the Power Pivot add-in
    As
    ryguy72 suggested, you can also leverage some other third party data processing tool
    according to your business requirement.
    Regards,
    Jeffrey
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to lock a single email?

    Hello everybody over there. I wonder how can I lock a single email in Mail? I need to lock a three-month account paper sent by my bank because my Mac is used by my girlfriend as well. Any idea?

    Dave Sawyer wrote:
    There is no way included in Mac OS X to prevent anyone who has access to your user account from seeing any given message in Mail. If you don't want your girlfriend reading specific email messages, it's probably most practical to just save them somewhere outside of Mail and delete them from Mail. Or as has been suggested give her a separate Mac OS X user account and then log out of yours when you're not using your computer.
    And no, there's no way to prevent Spotlight from being able to find any given file in a user account unless you place that file in a secure disk image or use another security utility such as Espionage which says it can also lock mail, though I don't know if can lock a single message (I think it only locks folders which would mean it possible could lock a mailbox, but not just a single message).
    Regards.
    There is a way to prevent Spotlight from searching single locations and that is through System Preferences>Spotlight>Privacy. I added the mailbox wherein that email currently is. I thought I could lock an email as I can with any folder on my Mac. Espionage is nice, but you are right as it only locks folders, not single messages.
    Thank you.

Maybe you are looking for

  • Duplicated workflows  for fast triggering event from CRM

    Hello, I'm facing an issue when a credit limit sales order is created in CRM. They are creating the order and manking a change to it 5 seconds later. Those created and changed events are triggered with a difference of 5 seconds and in background, the

  • Job doesn't work - but procedure does

    Hi all, I found some curious - for me. I added a job for a procedure. The procedure contains 3 execute immediate with create table statements. The tables will be created on the current database, where the procedure runs. But the third statement selec

  • Browser with white page

    I have a problem when I start the run time mode for any module , the browser display a white page, this problem was not happening, its suddenly started , the OC4J engine display this massage ( configFileName : g:\DevsuiteHome_1/forms/server/formsweb.

  • DIfferences between 1.2 (9i) and 1.1

    Hi, I am trying to figure out the differences between the new version of iFS (9.0 or 9i) and the previous version (1.1.9 in my case). Is there a a document somewhere outlining the major differences in features and requirements? In particular, I was c

  • Using native Logic OSC support with 3rd party plug-ins & new touchOSC maps

    Hi All. Now that logic from 9.1.2 has native OSC support, I wandered if anyone has used it succesfully with their own customised touchOSC maps? I'm not so interested in using touchsc as a transport/mixer for logic - which is what the default logic ma