How to set main thread Priority?

i have set:
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
// and the other thread ( )
thread_load = new Thread();
thread_load.setPriority(Thread.MIN_PRIORITY);
thread_load.start();but it doesn't make any diffrent,
i mean diffent the CPU usage for the thread.
i want the main thread has a MAX PRIORITY CPU usage , then the other thread.
is this true to set the thread priority use setPriority(..) ?
thx..

Thread is a Runnable within java (or javaw) process: his priority has no meaning outside the JVM, if you wanna impact on CPU usage you should set this process priority, i.e. (for windows):
instead of starting as
javaw ....try
start/min javaw ...You could need to quote the javaw command, to see all possible priorities see start help by typing start/? in cmd.
Bye.

Similar Messages

  • How to stop main thread ?

    Hi,
    Inside my java class, after I launch a GUI, I want to stop this main thread. After user make some choice and close GUI window, then, I want to go back to main thread. I use wait() method inside my class to stop main thread , but it does not work and it give me "IllegalMonitorStateException" error. I met same thing, when user close the GUI window and call method notifyAll(). How to stop main thread for a while and how to go back?? Thanks
    Gary

    Hi,
    you can create a boolean, and create a while loop, with a Thread.sleep(time); when you want to continue, you just have to change the state of your boolean. So you don't hava to exit the main. And you can't restart a run() in a thread. You can run it only once, so try to keep in your run() with an appropriate loop.
    Hope it helps.
    S�bastien

  • How to set main class in netbeans?

    i have a class with a main method that i want to set as my main class, but i dont have the source for it. how can i set it as my main class in netbeans?
    thanks!

    ya i can run in from the comand prompt, Excellent.
    and yeah your right it should be easy. It IS easy. You just did it.
    but for the life of me i cant figure it out. What can't you figure out? How to do the same thing in NetBeans?
    i dont know where else to turn.Let me suggest the NetBeans docs. I'm sure they've got something in there to tell users how to run a .class with a main() method.
    Better yet, keep doing things on the command line until you're knowledgable about NetBeans and leave the IDE alone until you know Java. Two mysteries at once is too much.
    %

  • How to solve: Main Thread (Suspended: Error: value of pendingCustomerTokenList must be a collection)

    Hi All,
    Have an app that I am creating in flashbuilder 4, java axis 2 web service and mysql.
    In my app I have defined a service.  I have had not problems with pulling data and inserting data
    by calling my java functions through the service.
    I added a new property and then made it available in flex.  it display on label field,  Ran the app and got the error:
    Error: value of pendingCustomerTokenList must be a collection
      at valueObjects::_Super_PendingTokensResponse/set pendingCustomerTokenList()[F:\vEngage\flexworkspace\FBAgentApp\src\valueObjects\_Super_Pe ndingTokensResponse.as:104]
      at com.adobe.serializers.utility::TypeUtility$/assignProperty()[/Users/sameer/depot/flex/ide _builder/com.adobe.flexbuilder.dcrad/serializers/src/com/adobe/serializers/utility/TypeUti lity.as:559]
      at com.adobe.serializers.utility::TypeUtility$/convertToStrongType()[/Users/sameer/depot/fle x/ide_builder/com.adobe.flexbuilder.dcrad/serializers/src/com/adobe/serializers/utility/Ty peUtility.as:498]
      at com.adobe.serializers.utility::TypeUtility$/convertResultHandler()[/Users/sameer/depot/fl ex/ide_builder/com.adobe.flexbuilder.dcrad/serializers/src/com/adobe/serializers/utility/T ypeUtility.as:372]
      at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\4.y\frameworks\projects \rpc\src\mx\rpc\soap\Operation.as:953]
      at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.y\frameworks\projects \rpc\src\mx\rpc\AbstractInvoker.as:313]
      at mx.rpc::Responder/result()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
      at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AsyncReq uest.as:84]
      at DirectHTTPMessageResponder/completeHandler()[E:\dev\4.y\frameworks\projects\rpc\src\mx\me ssaging\channels\DirectHTTPChannel.as:451]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/onComplete()
    I looked at the Network Monitor tab and examined the call/response.  Response body shows no error and the Response result shows the data returned by my java axis 2 function.  Its all correct.
    Ran configure return type again.  Let it auto-detect and return type from sample data. The properties returned looked just fine.
    Looked at the _Super_PendingTokensResponse.as on line 104
    var oldValue:ArrayCollection = _internal_pendingCustomerTokenList;              
            if (oldValue !== value)
                if (value is ArrayCollection)
                    _internal_pendingCustomerTokenList = value;
                else if (value is Array)
                    _internal_pendingCustomerTokenList = new ArrayCollection(value);
                else
                    throw new Error("value of pendingCustomerTokenList must be a collection");
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pendingCustomerTokenList", oldValue, _internal_pendingCustomerTokenList));
    How to I correct this problem ?
    thanks for any help.

    Have a look at these docs:
    E-CA Change Assistant gives error: All agents should be running and sending pulses for all application, batch, file and web servers for the environment before the Change Assistant is started (Doc ID 1073464.1)
    E-CA: PT8.53, PT8.52, PT8.51, PT8.50: EMF Agents not Finding Configuration Files for App Server, Batch Server (Doc ID 1080590.1)

  • How to set main host for Adapter Engine in the HA enviroment

    Hi, all.
    Our XI env. is like the following.
    XI 3.0 SP11 on Windows 2003 + SQL Server.
    Central Instance(ABAP + J2EE Addon) is running on Host A,
    Dialog Instances(ABAP + J2EE Addon) are running on Host B and Host C.
    Our design was to have J2EE Adapter engine mainly running on Host A(CI). But after installation, Adapter Engine is running on Host C(one of DIs). When we check from the Runtime WorkBench. It shows Adapter Engine is running on Host C while IS is running on the Host A(CI). 
    Where can we change this configuration? We want the J2EE AE running on the Central Instance Host.
    Any advice appreciated.
    Best Regards.

    Hi Sejoon,
    when we changed the host of XI server in one of our projects one of the things we had to change was the exchange profile entries
    http://server:port/exchangeProfile/index.html
    to see how your adapter engine is configured
    http://server:port/sld
    SLD -> Content Maintenance
    then
    Subset: landscape description
    Class: XI Adapter Framework
    buth check the exchange profile entries first
    Regards,
    michal

  • How to set the priority for Commit Server?

    Hi all,
    I want to know how to set up the priority for committing documents.
    I'm having two different odc applications and i want to commit documents belongs to one application (URGENT) as soon as it has complete the indexing. (I'm running commit server every second for this (URGENT) application).
    But once the commit server start to commit batches belongs to one application it continues until finishes, and then only it switch to the URGENT application even though indexed documents are there.I have tested with batch priority, Batch status fields in commit server.
    What is exactly happen in setting batch priority ?
    How do i switch commit serve to run urgent batches (which is belongs to another application) as soon as indexed??
    I can use ODC or ODDC.
    Thank You.....

    Don't worry - I'm more think aloud, so it is more a hypothesis than a solution.
    You write that
    We are using ODC to Index the documentsWhat exactly does this mean? If it means that a user types in metadata values, then you could take a look whether those metadata are needed for the item to be checked in (like the mentioned security group), or whether it is "other" metadata (e.g. supplier, invoice number, etc.) that you could, in theory, fill in in your application in IPM - imagine that you use IPM to check in the document and all you have is a TIFF.
    Btw. you also write that
    (we) use Input agent to sent documents to IPMI thought that ODC (Commit Profile) does this work for you, or not? If you use ODC to commit to a disk, and Input agent to get it from a disk to IPM, how about using a direct commit profile to IPM?

  • How to set gooogle priority inbox in blackberry q5 10.2

    I have been searching answer for this questions for months now. Gmail automatically puts emails into categories like primary, social, updates etc. I get 100 of emails a day of which hardly 5 are of importance to me. Is there anyway to set it up in blackberry. Someone said it can be done through settings tab in gmail where you can customise labels and categories. I have tried this a number of times but I can't understand how to set it up. Also there are gmail apps in blackberry but they won't integrate with blackberry hub so its kind of useless.

    Hi and Welcome to the Community!
    Depending on the type of mail account, yes or no. Go into Settings > Accounts and edit the email account in question. If, on the main screen and/or the Advanced screen, you see a field for "Sync Timeframe", then you can control it. If you do not see that field, then you cannot control it.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to set priority?

    Hello,
    Is there a way to set a priority symbol or number or anything of the sort beside a message in mail?
    I heard of it being done but I'm not sure.
    Also, how do I use mail and create an out of office reply or an email that will be automatically sent when someone sends an email to a given address?
    Thanks.
    Dorian

    You mean when sending a mail, how do you set priority? Is there a little rectangular box in the lower left-hand corner region of the message header area in your new message window composition window, that has three little horizontal lines and a downward pointing triangle in it? Click on it and select Customize....
    Check the far-right checkbox that has a pull-down menu with a "!" in it. That is message priority. "!!" means high priority, "!" means regular priority, and "-" means low priority.
    Or do you mean how do you display the priority of incoming mail? You can display priority of incoming messages by enabling the "Flag" column in your message list viewer pane. In the Mail's menubar, go to Mail > View > Columns and select Flags. You can drag that column to the desired position (mine is 2nd from left) and adjust its width in the column title row using your mouse. If you have placed the Flag icon in the toolbar of the main mail viewer window, then when you click on the icon, you can locally "flag" it (displays a little red flag in that column next to the message) to remind you that you have to do something with/about this message. To add the Flag button to your toolbar, in Mail's menubar, click on Mail > View > Customize Toolbar and drag the Flag icon into your toolbar.
    The best way I would know to create an out-of-office reply would be to create a temporary rule that says "if account is 'whatever' then reply" and enter text in the reply text window. Problem is, I don't know whether the rule would be executed until after the message was downloaded in your running mail application, or until the message was actually viewed. You'd have to experiment. If your computer is going to be shutdown or you will be logged out, that won't work, and you'd really need to be able to do something at the mail server level, not your mail client level.
    (if you find that this solves your problem, or is actually helpful towards arriving at a solution to your problem, please consider clicking on either the "helpful" or "solved" buttons in the header of this post)

  • How to set up my display to be the main view HELP

    How to set up my external display automatically work as the main display when plugged into my MacBook Pro. I had it set up to work this way on my old MBP but I got a new MBP with Mountian Lion and the Display set up seen different and I can figure out how to make my Apple HD display (about 3 years old) be the main display when I turn on my MBP. Mirror is off when I look at
    System pref’s – Display – Arrangement I just get to pick which display is left and right. I cant remember how it was set up on my old MBP. Mirroring does me no good. Any help will do!!!
    Thanks Brad

    In System Preferences > Displays > Arrangement tab.  Drag the little grey rectangular "menubar" to the other monitor.

  • How to make the main() thread wait?

    I would like to know how to make the main() thread wait for another thread?If I use wait() method in main() method it says "non-static method wait() cannot be referenced from a static context",since main()
    is static.

    Here is an example how you may wait for a Thread in the main -
    but be careful, this is no real OO:
    public class WaitMain {
    // this is the thread class - you may also create
    // a runnable - I use a inner class to
    // keep my example simple
         public static class ThreadWait extends Thread{
              public void doSomething(){
                   synchronized(syncObject){
                        System.out.println("Do Something");
                        syncObject.notify();
              public void run(){
                   // sleep 10 seconds - this is
                   // a placeholder to do something in the thread
                   try{
                        sleep(10000);
                        doSomething();
                        sleep(10000);
                   catch(InterruptedException exc){
    // this is the object we wait for -
    // it is just a synchronizer, nothing else
         private static Object syncObject = new Object();
         public static void main(String[] args) {
              System.out.println("This will start a thread and wait for \"doSomething\"");
              ThreadWait t= new ThreadWait();
              t.start();
              synchronized(syncObject){
                   try{
    // this will wait for the notify
                        syncObject.wait();
                        System.out.println("The doSomething is now over!");
                   catch(InterruptedException exc){
              // do your stuff

  • How to set Priority of JMS message in the Receiver adapter

    Hi,
    How can I set the priority of message going to MQ in the receiver JMS adapter. I tried to set a value in the <b>JMS message Priroty</b> field. But it is not working.
    In the receiving  queue manager the default priority of the queue which receives data is set to 0.
    Can anyone suggest how to get this done.
    Thanks in Advance
    Abinash

    Hi Ravi,
    If I am not wrong You are referring to article <b>Queues for Prioritized Message</b>. But this is about how to Prioritize message inside XI.
    What I am intresetd in is to set a message priority (for example "2")for the message going to MQ. That is when the message reached the detination queue the priority of this message should be 2 in the queue.
    Thanks
    Abinash

  • How to set the value of something in a component from the main application?

    Hi,
    Maybe I've been working on this too long, but I can't figure
    out how to set the value of the text property of a text input field
    in a component from my main application in an mx:Script block. I
    have a component called Login in the components folder, and I need
    to set the text value of empNum. In my mxml declaration at that the
    top, I've declared these components as xmlns:c="components.*" So
    logically, the property I'm trying to set is c.Login.empNum.text. I
    can't figure out the correct syntax to get this to work, and I've
    tried everything I can think of. Does anyone have any suggestions?
    I'm thinking this should be an easy one, and I'm just missing
    something.
    Thanks!
    Holli

    Did you try giving it an id ?
    <c:MyLogin id="loginScreen" /c>
    So later you can do loginScreen .empNum.text = "my text"
    Laurent,

  • How to set the HOME link from two frame jsp page to no frame main page?

    Hi all,
    i have one main jsp page named as main.jsp.
    From the main.jsp, i can click the button and link to the twoFrame.jsp.
    This twoFrame.jsp have another two different jsp inside the frame called Aframe.jsp and Bframe.jsp.
    i try to put HOME in the Aframe.jsp(one of the page inside twoFrame.jsp) but only the Aframe.jsp manage to link to main.jsp but the Bframe still there.
    My question is: How to set the HOME link button from this twoFrame.jsp to the main.jsp? what i want is from twoFrame.jsp(two frame) to main.jsp(no frame).
    rgds,
    Bryan523

    No offense, but this is basic HTML. You shuold look into learning HTML before getting too deep into JSP. Try this: http://www.w3schools.com/html/default.asp
    But as a more specific answer, you have to set a target for the link to the _parent of your frame:
    <a href="main.jsp" target="_parent">Home</a>

  • How to set dynamicaly the task-priority in a Process?

    Hello all,
    Once again with a question: Exists any way for set dynamicaly the priority in a human task?
    Because, we need to change this task attribute in runtime
    Thanks in advance again!

    Even in 7.3, I think you can achieve this only via API.
    There is no expression editor for priority

  • How to set tabs and how to set them outside the margins of my main body of text

    I type lots of docs where I have a body of text, indented, and then there is an action letter, A,B,C etc, out to the right.  Can't see how to set the body of text plus separate tab outside the margin in Pages.  Could do it in MS Word.  Pages looks great, but I'm stuck on a few things I used to do.  Can anyone help?
    Thanks

    Hi Peter
    Thanks for the reply.
    Here is a sample of the text:
    you'll see that the D, C, B etc are squashed up to the text, I can't move their tab outside the margin.  On Word (dare I say it?) I could set my right hand margin and still have a tab further out.  Don't know that your anchoring idea is the thing.  Is there another way to limit my text?  I wonder about columns, although then all the ABCs will be in the second won't they?
    Any ideas?
    Thanks again
    Nonie

Maybe you are looking for