Per swf per instance, per thread,  is it?

When there are multiple .swfs  in one web page,  if there will be multiple instaces of flashPlayer -- and run in multiple thread?

hi,
   It will not work at all In web browser enviornment. If you considering to
make a scheme in which u use two swfs one helper swf for background
processing and another for Displaying Front End.Problem remains there if you
manage to send data from your one swf to the other in same page using
localConnection . When the processing starts in the helper swf whole page
will going to be stucked for the period until the helper swf has done
processing the data.So its no use at all. Altough this library can help you
make time slice based threads http://code.google.com/p/async-threading/

Similar Messages

  • Multiple log groups per thread to improve performance with high redo writes

    I am reading Pro Oracle 10g RAC on Linux (good book). On p.35 the authors state that they recommend 3-5 redo log groups per thread if there is a "large" amount of redo.
    Who does having more redo log groups improve performance? Does oracle paralelize the writes?

    redo logs are configured per instance, from experience you need atleast 3 redo log groups per thread to help switch over and sufficient time for archives to complete before reuse of the first redo log group. When you have a large redo log activity there is a potential that redo log groups will switch more often and it is important that archive has completed before an exisiting redo log group can be reused, else the database /instance may hang.
    I think that is what the author is referencing here, have sufficient redo log groups (based on the acitivty of your environment) to allow switching and allowing sufficient time for archives to complete.

  • Weblogic DataSource connection per thread

    Hi,
    We are using spring-jdbc to call stored procs (Sybase database) from a web-app. We can't use spring-transactions because the stored procs are all unchained. We look up the DataSource that is configured in Weblogic using JNDI like
         <bean id="dataSource"
              class="org.springframework.jndi.JndiObjectFactoryBean">
              <property name="jndiName" value="/jdbc/MyDataSource" />
         </bean>
    We pass the DataSource to the spring StoredProc class and internally it calls dataSource.getConnection to get the connection. I would like to know if dataSource.getConnection will always return the same connection per thread. I mean to say that is there something like ThreadLocal implementation that ensures that if I am calling 4 stored procs in one web transaction (not a real JTA), only one connection will be used to call all the SPs even if I am not using any transactions. Will appreciate any help.
    Regards,
    G

    Hi Joe,
    Thanks a lot for your explanation.
    I do have "Supports Global Transactions" checked. We are not doing any transaction management at all.
    When you say
    1 - WebLogic is managing the transaction
    Does it means that weblogic starts a transaction for every http request?
    All I want is that within one HTTP request, all the calls to the database should be made from one jdbc connection. We are not spawning any threads ourselves.
    It is a simple web app with a complex legacy sybase database. For some reason, for an http request, I need to call
    select set_appcontext (?,?,?)
    several stored proc calls
    select get_appcontext (?,?)
    select rm_appcontext (?,?)
    I need to make sure that all these procs are called from the same connection. Can't use a JTA transaction. Adhering to ACID properties is not the aim. All that is needed is that every stored proc is called from the same JDBC connection (that we are getting from dataSource.getConnection).
    Can I assume that no matter how many times I call dataSource.getConnection during the life of the http request, I will get the same connection?
    Appreciate your help.
    Regards,
    G

  • CPU Usage per thread

    I have been looking for an accurate way to obtain the cpu usage time per thread in a multi-threaded C,C++ application and I have not been able to find a way to do so. Is there a library which gives you access to this information? Standard time functions like getrusage, time, times, and clock are all per process.
    Thanks for your help in advance,
    Tom

    Shark also does this pretty well, albeit indirectly (% of app CPU time per thread) ...
    Regards,
    John
    Falling You - exploring the beauty of voice and sound
    http://www.fallingyou.com

  • How to create object per thread

    Hi everyone,
    This is my problem. I want to have a static method. Inside of it I want to add an element into a List, let's say I want to track something by doing this. But I also want this List to have multiple copies depending on threads, which means for every call to this static method, I want to call the "add" method on different List objects depending which thread it is from.
    Does it make sense? Do I need to have a thread pool to keep those thread references or something?
    How about I use Thread.currentThread() to determine whether this call is from a different thread so that I create another List?
    Thank you very much!
    Edited by: feiya200 on Feb 26, 2008 10:31 PM

    want to be perfect with singleton as why it is needed and how it works so see this by [email protected], Bijnor
    For those who haven't heard of design patterns before, or who are familiar with the term but not its meaning, a design pattern is a template for software development. The purpose of the template is to define a particular behavior or technique that can be used as a building block for the construction of software - to solve universal problems that commonly face developers. Think of design code as a way of passing on some nifty piece of advice, just like your mother used to give. "Never wear your socks for more than one day" might be an old family adage, passed down from generation to generation. It's common sense solutions that are passed on to others. Consider a design pattern as a useful piece of advice for designing software.
    Design patterns out of the way, let's look at the singleton. By now, you're probably wondering what a singleton is - isn't jargon terrible? A singleton is an object that cannot be instantiated. At first, that might seem counterintuitive - after all, we need an instance of an object before we can use it. Well yes a singleton can be created, but it can't be instantiated by developers - meaning that the singleton class has control over how it is created. The restriction on the singleton is that there can be only one instance of a singleton created by the Java Virtual Machine (JVM) - by prevent direct instantiation we can ensure that developers don't create a second copy.
    So why would this be useful? Often in designing a system, we want to control how an object is used, and prevent others (ourselves included) from making copies of it or creating new instances. For example, a central configuration object that stores setup information should have one and one only instance - a global copy accessible from any part of the application, including any threads that are running. Creating a new configuration object and using it would be fairly useless, as other parts of the application might be looking at the old configuration object, and changes to application settings wouldn't always be acted upon. I'm sure you can think of a other situations where a singleton would be useful - perhaps you've even used one before without giving it a name. It's a common enough design criteria (not used everyday, but you'll come across it from time to time). The singleton pattern can be applied in any language, but since we're all Java programmers here (if you're not, shame!) let's look at how to implement the pattern using Java.
    Preventing direct instantiation
    We all know how objects are instantiated right? Maybe not everyone? Let's go through a quick refresher.
    Objects are instantiated by using the new keyword. The new keyword allows you to create a new instance of an object, and to specify parameters to the class's constructor. You can specify no parameters, in which case the blank constructor (also known as the default constructor) is invoked. Constructors can have access modifiers, like public and private, which allow you to control which classes have access to a constructor. So to prevent direct instantiation, we create a private default constructor, so that other classes can't create a new instance.
    We'll start with the class definition, for a SingletonObject class. Next, we provide a default constructor that is marked as private. No actual code needs to be written, but you're free to add some initialization code if you'd like.
    public class SingletonObject
         private SingletonObject()
              // no code req'd
    So far so good. But unless we add some further code, there'll be absolutely no way to use the class. We want to prevent direct instantiation, but we still need to allow a way to get a reference to an instance of the singleton object.
    Getting an instance of the singleton
    We need to provide an accessor method, that returns an instance of the SingletonObject class but doesn't allow more than one copy to be accessed. We can manually instantiate an object, but we need to keep a reference to the singleton so that subsequent calls to the accessor method can return the singleton (rather than creating a new one). To do this, provide a public static method called getSingletonObject(), and store a copy of the singleton in a private member variable.
    public class SingletonObject
    private SingletonObject()
    // no code req'd
    public static SingletonObject getSingletonObject()
    if (ref == null)
    // it's ok, we can call this constructor
    ref = new SingletonObject();
    return ref;
    private static SingletonObject ref;
    So far, so good. When first called, the getSingletonObject() method creates a singleton instance, assigns it to a member variable, and returns the singleton. Subsequent calls will return the same singleton, and all is well with the world. You could extend the functionality of the singleton object by adding new methods, to perform the types of tasks your singleton needs. So the singleton is done, right? Well almost.....
    Preventing thread problems with your singleton
    We need to make sure that threads calling the getSingletonObject() method don't cause problems, so it's advisable to mark the method as synchronized. This prevents two threads from calling the getSingletonObject() method at the same time. If one thread entered the method just after the other, you could end up calling the SingletonObject constructor twice and returning different values. To change the method, just add the synchronized keyword as follows to the method declaration :-
    public static synchronized
         SingletonObject getSingletonObject()
    Are we finished yet?
    There, finished. A singleton object that guarantees one instance of the class, and never more than one. Right? Well.... not quite. Where there's a will, there's a way - it is still possible to evade all our defensive programming and create more than one instance of the singleton class defined above. Here's where most articles on singletons fall down, because they forget about cloning. Examine the following code snippet, which clones a singleton object.
    public class Clone
         public static void main(String args[])
         throws Exception
         // Get a singleton
         SingletonObject obj =
         SingletonObject.getSingletonObject();
         // Buahahaha. Let's clone the object
         SingletonObject clone =
              (SingletonObject) obj.clone();
    Okay, we're cheating a little here. There isn't a clone() method defined in SingletonObject, but there is in the java.lang.Object class which it is inherited from. By default, the clone() method is marked as protected, but if your SingletonObject extends another class that does support cloning, it is possible to violate the design principles of the singleton. So, to be absolutely positively 100% certain that a singleton really is a singleton, we must add a clone() method of our own, and throw a CloneNotSupportedException if anyone dares try!
    Here's the final source code for a SingletonObject, which you can use as a template for your own singletons.
    public class SingletonObject
    private SingletonObject()
    // no code req'd
    public static SingletonObject getSingletonObject()
    if (ref == null)
    // it's ok, we can call this constructor
    ref = new SingletonObject();          
    return ref;
    public Object clone()
         throws CloneNotSupportedException
    throw new CloneNotSupportedException();
    // that'll teach 'em
    private static SingletonObject ref;
    Summary
    A singleton is an class that can be instantiated once, and only once. This is a fairly unique property, but useful in a wide range of object designs. Creating an implementation of the singleton pattern is fairly straightforward - simple block off access to all constructors, provide a static method for getting an instance of the singleton, and prevent cloning.
    What is a singleton class?
    A: A class whose number of instances that can be instantiated is limited to one is called a singleton class. Thus, at any given time only one instance can exist, no more.
    Q: Can you give me an example, where it is used?
    A: The singleton design pattern is used whenever the design requires only one instance of a class. Some examples:
    �     Application classes. There should only be one application class. (Note: Please bear in mind, MFC class 'CWinApp' is not implemented as a singleton class)
    �     Logger classes. For logging purposes of an application there is usually one logger instance required.
    Q: How could a singleton class be implemented?
    A: There are several ways of creating a singleton class. The most simple approach is shown below:
    Code:
    class CMySingleton
    public:
    static CMySingleton& Instance()
    static CMySingleton singleton;
    return singleton;
    // Other non-static member functions
    private:
    CMySingleton() {}; // Private constructor
    CMySingleton(const CMySingleton&); // Prevent copy-construction
    CMySingleton& operator=(const CMySingleton&); // Prevent assignment
    Can I extend the singleton pattern to allow more than one instance?
    A: The general purpose of the singleton design pattern is to limit the number of instances of a class to only one. However, the pattern can be extended by many ways to actually control the number of instances allowed. One way is shown below...
    class CMyClass
    private:
    CMyClass() {} // Private Constructor
    static int nCount; // Current number of instances
    static int nMaxInstance; // Maximum number of instances
    public:
    ~CMyClass(); // Public Destructor
    static CMyClass* CreateInstance(); // Construct Indirectly
    //Add whatever members you want
    };

  • Per-thread NI-488.2 globals (ThreadIbsta, ThreadIberr, ThreadIbcnt)

    in my application do include Ni488.2 library and program to make gpib call, such as Write("*IDN?"). Then check Ni Spy, there are ThreadIbsta, ThreadIberr and ThreadIbcntl. Is possible to remove these three by any setting?

    Hello
    I doubt that these functions would cause such a difference in performance. Do you have any sample app I could use to test this out? Going from Vb 6 to C++ is quite a big change and I would like to see how you have set this up. Are you making use of multiple threads in your test application?
    There really is no way to disable these functions in the C++ class libraries. In the VB ActiveX controls, we were going similar operations to check the status, but we were directly accessing the ib globals to check their status (which is why you dont see any status checking calls in NI Spy when you used the CWInstr ActiveX controls). VB 6 is pretty much single threaded and so you do not need thread specific status information.
    But the C++ class libraries allow for more versatile use, since C++ applications can easily be multiple threaded. The libraries need to be able to provide the user with error information that might be specific with the thread in which the function is being called and so we use the thread specific status functions like ThreadIbsta after each function call.
    Based on the benchmarking and testing we have done internally, you should not see such a significant difference in performance between the two APIs, especially if the tasks are the same.
    You can turn off exceptions for the Cni4882 libraries by calling the static method CNiException:etExceptionMode(). But again, this would not turn off the thread specific status checking built into the libraries.
    I would like to test out your sample app on my system and see if I can reproduce the effects you are seeing. If you have a VB 6.0 app that I could compare it to, that would help as well.
    Thanks
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Sol. 10 T5120  T2 SPARC CPU utilization per thread...

    Hello all:
    We have an issue with a t5120 server UltraSPARC T2 (32 cores) . We installed oracle 10g on the global zone. When we run oracle the process cannot use more than 3.2% CPU (It shows in prstat). Also when whe run a cpuhog (while :; do :; done ) we cannot get also more than 3.2% CPU.
    When we can get more CPU is connect with the same user two or more times and run the cpu hog script
    this way when can get 3.2 CPU for each connection.
    We tried using FSS, TS. But no luck We read a lot o zones, cpu-shares, etc.
    We are DBA's , so the question is..is there a default cap on CPU use the solaris has?
    We found no capping no the global zone !
    Your help is appreciated !

    Single-threaded applications can use no more than 1 CPU at a time. If you have 32 CPUs online, then each CPU is about 3.2% of the system CPU total.
    I'm sure Oracle can make use of multiple threads depending on exactly what you're doing.
    Darren

  • Page flow controller - instance variable thread safe?

    I have page flow controller that is a subclass of org.apache.beehive.netui.pageflow.PageFlowController runing weblogic 921. The essence of my question is: is instance variable of page flow controller thread safe?
    Here are the details. I have an instance variable “status” that stores the status of the patient, which is stored in the request. It sets the status with after the patient status is retrieved from database. The set method is not synchronized.
    This works fine during normal test. But it failed during load test. Does a page flow controller instance shared among different requests? If so, how can I store the status for each request?
    Thanks,
    G T

    Hello
    You seem to put your question on the wrong forum
    Oracle Beehive and Apache Beehive are two different products...
    Have a look on http://beehive.apache.org
    Cheers
    Fred

  • Loaded flash 8 swf's instance problem !

    Hi,
    I am loading a Flash 8 .swf file in Flex 3. Initially its
    working fine.
    But whenever we tried to load a another instance of that swf
    or trying to load in a separate container again, its producing
    wrong output with colors and mouse events.
    We tried with the same swf file making two different file
    (map1.swf, map2.swf), and loading them separately. But its also
    buggy.
    The MovieClip structure of one swf (map1.swf) in flash is
    like - _level0.Map.Map.NA.
    We made one swf 's (map2.swf) structure to test like -
    _level0.Map2.Map.NA
    Where colours of 'NA' instances are depending on xml and
    mouse event applied to them.
    If we load them in Flex 3 and trace out the loaded swf
    instances, whichever swf loaded first, flex started to use those
    instances everywhere.
    e.g. If map2.swf loaded first and map1.swf second, then Flex
    debug console shows -
    '_root.Map2.Map.NA' - for map2.swf and
    '_level0.diff_map_load0.pan2.contentPane.UIComponent33.instance37.instance67.Map2.Map.NA'
    - for map1.swf.
    Again, If map1.swf loaded first and map2.swf second, then
    Flex debug console shows -
    '_root.Map.Map.NA' - for map1.swf and
    '_level0.diff_map_load0.pan2.contentPane.UIComponent33.instance37.instance67.Map.Map.NA'
    - for map1.swf
    For both of the cases which one is loaded first, working
    correctly and the second one producing wrong results with colors
    and mouse events.
    Help and Suggestions needed.
    Thanks,
    Debasish Bouri.

    Authorware is old. EOD'd, in fact now.
    It's native support only officially handles Flash 6. Flash 7
    usually
    works fine if nothing 'fancy' (i.e. new components) has been
    added to
    the SWF. Flash 8 and above, however, pretty much aren't going
    to work at
    all in Authorware *using the native sprite*.
    However, if you add the Shockwave Flash ActiveX control to
    your
    flowline, that uses the same control as IE does. So as long
    as your user
    has the Flash IE player on their machine, you can load
    whatever SWF
    version that player supports.
    Working with the ActiveX control is a bit more tricky. Check
    the ActiveX
    example in your Authorware 7\ShowMe directory for an
    example...
    The biggest downside to the ActiveX approach is those SWFs
    are 'always
    on top'. Makes for good playback but you can't layer anything
    on top of
    those SWFs unfortunately (except maybe other ActiveX
    controls, which
    causes lots of flickering).
    HTH
    Erik
    Jacks007 wrote:
    > Hi All,
    > I've been creating SWF's in Flash v6 (I think it was v6)
    and they worked fine
    > in AW 7. I now have Studio 8 and can't get them to open
    in AW7 without saving
    > as the earlier version. Does anyone know why it does not
    work or if AW needs
    > an update to get the Flash 8's to work in AW as a
    Version 8 SWF?
    >

  • Loading SWF giving Instance name as TimeLine

    I'm Loading swf into a movieclip name main_mc. After
    successfully loading it into main_mc. I had written a function to
    get all children present in that movieclip(main_mc). It is getting
    Children present in that, but every time it give [Object
    MainTimeLine] as instance3 or sometime instance10. How can i
    control instance name of maintimeline as it is randomly getting its
    name.... I'm attaching code use in getting child and loading it...
    Plz check if their any problem in code.
    quote:
    Clip=new Loader();
    var urlRequest:URLRequest=new URLRequest("test.swf");
    Clip.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadingDone);
    Clip.load(urlRequest);
    private function LoadingDone(event:Event):void {
    var _mc:MovieClip=event.target.content as MovieClip;
    main_mc.addChildAt(_mc,0);
    //if i trace the name of _mc movieclip... it will instance4
    or instance10 randomly
    trace(_mc.name);
    showChildren(stage,0);
    function showChildren(dispObj, indentLevel:Number):void {
    for (var i:uint = 0; i < dispObj.numChildren; i++) {
    var obj:DisplayObject = dispObj.getChildAt(i);
    if (obj is DisplayObjectContainer) {
    trace(padIndent(indentLevel), obj.name, obj);
    showChildren(obj, indentLevel + 1);
    } else {
    trace(padIndent(indentLevel) + obj);
    function padIndent(indents:int):String {
    var indent:String = "";
    for (var i:uint = 0; i < indents; i++) {
    indent += " ";
    return indent;
    when loading is done suppose test.swf has one_mc movieclip
    Children traced are like that...
    quote:
    main_mc [object MovieClip]
    instance3 [object MainTimeline]
    one_mc [object MovieClip]
    [object Shape]
    Can we solve this problem...

    you can't control the instance name of a main timeline. but
    if you name everything else, the main timeline will be the only
    object whose instance name starts with "instance".

  • Load SWF with instances into MC

    Hello,
    I have a SWF called "player.swf", and it contains instances
    like: "head", "body" etc...
    I want to load that SWF into another SWF
    ("display_player.swf"), and to load ANOTHER SWF to replace the
    "head" instance, like:
    "_root.p" is a transparent red colored movie clip inside
    "display_player.swf"
    I tried doing this:
    _root.p.loadMovie("player.swf");
    trace(_root.p.head);
    "_root.p" said to be "_level0.p" and is displayed correctly,
    but "_root.p.head" said to be undefined (NaN)...
    Does anyone has an idea on how to load a SWF inside a movie
    clip, and use it's instances?

    The point here is to demostrate, or at least determine, what
    the problem is. I have stated that it is probably likely that you
    are making the call to _root.p.head previous to it being
    instatiated on the timeline. you must wait for the swf to load
    before the clip within the loaded swf can be made available to
    target. A better method would be to use the MovieClipLoader class,
    and then use the onLoadInit handler, this handler is displatched
    when the swf becomes available to the timeline, then within the
    handler you could call your trace, or load into the 'head' instance
    at the correct time.
    I have made an example to demostrate this, using
    representations of you clips and swfs:
    HERE
    PS. launch the items from within the folder.

  • SWF als footer in thread

    wie vermeide ich, dass meine swf welches als footer in einem
    forum angezeigt
    wird mehrfach sound abspielt ?
    danke
    pi

    naja das geht dann entweder über local connection
    oder auch über local shared object aka flashcookie
    Gruß Dominik (IPXLAN) ƒranzrahe
    Ganz neu, ganz frisch:
    http://www.superskank.com
    ICQ:165771582
    Skype: ipxlan
    shock-box
    mail: ipxlan<@>gmx.de
    site:
    http://www.shock-box.net
    spirit link
    mail: dominik.franzrahe<@>spiritlink.de
    site:
    http://www.spiritlink.de

  • Kernel parameters -maximum threads per process

    How can we change the kernel parameters also how can we increase the maximum number of threads allowed .
    How can we increase maimum perocess per used id .

    There is no kernel parameter limiting the maximum
    number of threads allowed. If you are talking about
    user level threads, you will run into virtual address
    space limitations at about 3000 for a process
    assuming 32-bit address space and default
    stack size of 1M per thread, and assuming you are
    not using the alternate thread library (see threads(3thr))
    or Solaris 9. If you need more than this many
    threads at the same time, I suspect you are doing something
    incorrectly. Otherwise, try using a smaller stack size
    per thread. If you are running on Solaris 9, or using
    the alternate thread library, both give you a 1x1
    thread model, i.e., each user thread has a corresponding
    kernel entity (lwp). In this case, you will cause
    your machine to hang by eating up all available
    space for lwp's. In either case, the question should be:
    "how do I limit the number of threads per process?", since
    there is currently no limitation other than space.
    In Solaris 9, you can use resource management to
    limit the number of lwp's (and therefore user threads)
    per process.

  • How many of these objects should I be able to insert per second?

    I'm inserting these objects using default (not POF) serialization with putAll(myMap). I receive about 4000 new quotes per second to put in the cache. I try coalescing them to various degrees but my other apps are still slowing down when these inserts are taking place. The applications are listening to the cache where these inserts are going using CQCs. The apps may also be doing get()s on the cache. What is the ideal size for the putAll? If I chop up myMap into batches of 100 or 200 objects then it increases the responsiveness of other apps but slows down the overall time to complete the putAll. Maybe I need a different cache topology? Currently I have 3 storage enabled cluster nodes and 3 proxy nodes. The quotes go to a distributed-scheme cache. I have tried both having the quote inserting app use Extend and becoming a TCMP cluster member. Similar issues either way.
    Thanks,
    Andrew
    import java.io.Serializable;
    public class Quote implements Serializable {
        public char type;
        public String symbol;
        public char exch;
        public float bid = 0;
        public float ask = 0;
        public int bidSize = 0;
        public int askSize = 0;
        public int hour = 0;
        public int minute = 0;
        public int second = 0;
        public float last = 0;
        public long volume = 0;
        public char fastMarket; //askSource for NBBO
        public long sequence = 0;
        public int lastTradeSize = 0;
        public String toString() {
            return "type='" + type + "'\tsymbol='" + symbol + "'\texch='" + exch + "'\tbid=" +
                    bid + "\task=" + ask +
                    "\tsize=" + bidSize + "x" + askSize + "\tlast=" + lastTradeSize + " @ " + last +
                    "\tvolume=" + volume + "\t" +
                    hour + ":" + (minute<10?"0":"") + minute + ":" + (second<10?"0":"") + second + "\tsequence=" + sequence;
        public boolean equals(Object object) {
            if (this == object) {
                return true;
            if ( !(object instanceof Quote) ) {
                return false;
            final Quote other = (Quote)object;
            if (!(symbol == null ? other.symbol == null : symbol.equals(other.symbol))) {
                return false;
            if (exch != other.exch) {
                return false;
            return true;
        public int hashCode() {
            final int PRIME = 37;
            int result = 1;
            result = PRIME * result + ((symbol == null) ? 0 : symbol.hashCode());
            result = PRIME * result + (int)exch;
            return result;
        public Object clone() throws CloneNotSupportedException {
            Quote q = new Quote();
            q.type=this.type;
            q.symbol=this.symbol;
            q.exch=this.exch;
            q.bid=this.bid;
            q.ask = this.ask;
            q.bidSize = this.bidSize;
            q.askSize = this.askSize;
            q.hour = this.hour;
            q.minute = this.minute;
            q.second = this.second;
            q.last = this.last;
            q.volume = this.volume;
            q.fastMarket = this.fastMarket;
            q.sequence = this.sequence;
            q.lastTradeSize = this.lastTradeSize;
            return q;
    }

    Well, firstly, I surprised you are using "float" objects in a financial object, but that's a different debate... :)
    Second, why aren't you using pof? Much more compact from my testing; better performance too.
    I've inserted similar objects (but with BigDecimal for the numeric types) and seen insert rates in the 30-40,000 / second (single machine, one node). Obviously you take a whack when you start the second node (backup's being maintained, plus that node is probably on a separate server, so you are introducing network latency.) Still, I would have thought 10-20,000/second would be easily doable.
    What are the thread counts on the service's you are using?; I've found this to be quite a choke point on high-throughput caches. What stats are you getting back from JMX for the Coherence components?; what stats from the server (CPU, Memory, swap, etc)?; What spec of machines are you using? Which JVM are you using? How is the JVM configured? What's are the GC times looking like? Are you CQC queries using indexes? Are your get()'s using indexes, or just using keys? Have you instrumented your own code to get some stats from it? Are you doing excessive logging? So many variables here... Very difficult to say what the problem is with so little info./insight into your system.
    Also, maybe look at using a multi-threaded "feeder" client program for your trades. That's what I do (as well as upping the thread-count on the cache service thread) and it seems to run fine (with smaller batch sizes per thread, say 50.) We "push" as well as fully "process" trades (into Positions) at a rate of about 7-10,000 / sec on a 4 server set-up (two cache storage nodes / server; two proxies / server.) Machines are dual socket, quad-core 3GHz Xeons. The clients use CQC and get()'s, similar to your set-up.
    Steve

  • Per-request singleton

    I am coming from the .NET world and am relatively new to Java web apps. A construct I have found very useful in .NET is having a class that acts as a singleton to provide services to other classes on a per-request basis. In other words, for the purposes of that request the class is a singleton. I would use it, for example, to signal the beginning and end of a SQL transaction. .NET has the concept of "thread-static", which means that a member variable can be declared static on a per-thread (or per-request) basis. I cannot simply declare an variable "static" in Java because it would be available to all simultaneous requests, which would be an error. Is there a way of doing this in Java?
    Thanks,
    Kevin

    This is definitely the Java part of what I need. Thanks! Now, the remaining part is to figure out the - I assume javax part, which allows me to insert code that is executed at the beginning of a request and at the end. I assume there is some javax class that I need to extend, or an interface I must implement in order to get this. The ServletContextListener class allows me to hook into web app startup and shutdown, but not each request.
    Kevin

Maybe you are looking for