Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 81/606 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • C-states and P-states : confounding factors for benchmarking

    - by Dave
    I was recently looking into a performance issue in the java.util.concurrent (JUC) fork-join pool framework related to particularly long latencies when trying to wake (unpark) threads in the pool. Eventually I tracked the issue down to the power & scaling governor and idle-state policies on x86. Briefly, P-states refer to the set of clock rates (speeds) at which a processor can run. C-states reflect the possible idle states. The deeper the C-state (higher numerical values) the less power the processor will draw, but the longer it takes the processor to respond and exit that sleep state on the next idle to non-idle transition. In some cases the latency can be worse than 100 microseconds. C0 is normal execution state, and P0 is "full speed" with higher Pn values reflecting reduced clock rates. C-states are P-states are orthogonal, although P-states only have meaning at C0. You could also think of the states as occupying a spectrum as follows : P0, P1, P2, Pn, C1, C2, ... Cn, where all the P-states are at C0. Our fork-join framework was calling unpark() to wake a thread from the pool, and that thread was being dispatched onto a processor at deep C-state, so we were observing rather impressive latencies between the time of the unpark and the time the thread actually resumed and was able to accept work. (I originally thought we were seeing situations where the wakee was preempting the waker, but that wasn't the case. I'll save that topic for a future blog entry). It's also worth pointing out that higher P-state values draw less power and there's usually some latency in ramping up the clock (P-states) in response to offered load. The issue of C-states and P-states isn't new and has been described at length elsewhere, but it may be new to Java programmers, adding a new confounding factor to benchmarking methodologies and procedures. To get stable results I'd recommend running at C0 and P0, particularly for server-side applications. As appropriate, disabling "turbo" mode may also be prudent. But it also makes sense to run with the system defaults to understand if your application exhibits any performance sensitivity to power management policies. The operating system power management sub-system typically control the P-state and C-states based on current and recent load. The scaling governor manages P-states. Operating systems often use adaptive policies that try to avoid deep C-states for some period if recent deep idle episodes proved to be very short and futile. This helps make the system more responsive under bursty or otherwise irregular load. But it also means the system is stateful and exhibits a memory effect, which can further complicate benchmarking. Forcing C0 + P0 should avoid this issue.

    Read the article

  • How to set up global connect to datebase in pylons(python), sqlalchemy.

    - by gummmibear
    Hi! I just start lern python, pylons. i have problem with setting up datebase connection. i won't to set connection, where i can see this connection in all my controllers. Now i use: some thing like this in my controller: 45 ' db = create_engine('mysql://root:password@localhost/python') 46 ' metadata = MetaData(db) 47 48 ' email_list = Table('email',metadata,autoload=True) in development.ini i have: 44 sqlalchemy.url = mysql://root@password@localhost/python 45 sqlalchemy.pool_recycle = 3600 and now, pleas help me to set __init__.py

    Read the article

  • How do I tag files in a directory in a SVN repository with a global version number that will appear

    - by mithaldu
    I am working on a project that stores multiple versions in the same svn repo but in different directories. For ease of reference for the coders working on the project I'd like to be able to add a commented tag similarly to # $Revision: 144 $ However, instead of the file revision it should contain a simple version number like so: # $Version: 1.63 $ # $Version: 1.64 $ # $Version: 2.0 $ Is there a way to get subversion to do this automatically for a specific directory and all sub-directories as well as for any new files added to those?

    Read the article

  • Xpath expression to retrieve oldest/earliest node

    - by gkrogers
    I have an XML snippet, so: <STATES> <STATE> <NAME>Alabama</NAME> <ABBREVIATION>AL</ABBREVIATION> <CAPITAL>Montgomery</CAPITAL> <POPULATION>4661900</POPULATION> <AREA>52419</AREA> <DATEOFSTATEHOOD>14 December 1819</DATEOFSTATEHOOD> </STATE> <STATE> <NAME>Alaska</NAME> <ABBREVIATION>AK</ABBREVIATION> <CAPITAL>Juneau</CAPITAL> <POPULATION>698473</POPULATION> <AREA>663268</AREA> <DATEOFSTATEHOOD>1 January 1959</DATEOFSTATEHOOD> </STATE> <STATE> <NAME>Delaware</NAME> <ABBREVIATION>DE</ABBREVIATION> <CAPITAL>Dover</CAPITAL> <POPULATION>885122</POPULATION> <AREA>2490</AREA> <DATEOFSTATEHOOD>7 December 1787</DATEOFSTATEHOOD> </STATE> </STATES> <etc, etc.> I want to retrieve (for example) the capital of the oldest state (i.e. "Dover"). I have managed to get this far: //STATES/STATE[DATEOFSTATEHOOD='7 December 1787']/CAPITAL/text() but can't figure out how to say 'DATEOFSTATEHOOD={the earliest DATEOFSTATEHOOD}'. Can anybody point me in the right direction, please? SOLUTION: Matt's solution is more or less spot on. I had to reformat the dates (I used YYYYMMDDD) because, as was pointed out, Xpath 1.0 doesn't support the date format I was using. Also, Microsoft's XML library (4.0 and 6.0) returned the whole node list with Matt's expression. Reversing the test fixed that problem, making it return just the earliest node. So: //STATES/STATE[(DATEOFSTATEHOOD < //STATES/STATE/DATEOFSTATEHOOD)]/CAPITAL/text()

    Read the article

  • How to salvage SQL server 2008 query from KILLED/ROLLBACK state without waiting half a day?

    - by littlegreen
    I have a stored procedure that inserts batches of millions of rows, emerging from a certain query, into an SQL database. It has one parameter selecting the batch; when this parameter is omitted, it will gather a list of batches and recursively call itself, in order to iterate over batches. In (pseudo-)code, it looks something like this: CREATE PROCEDURE spProcedure AS BEGIN IF @code = 0 BEGIN ... WHILE @@Fetch_Status=0 BEGIN EXEC spProcedure @code FETCH NEXT ... INTO @code END END ELSE BEGIN -- Disable indexes ... INSERT INTO table SELECT (...) -- Enable indexes ... Now it can happen that this procedure is slow, for whatever reason: it can't get a lock, one of the indexes it uses is misdefined or disabled. In that case, I want to be able kill the procedure, truncate and recreate the resulting table, and try again. However, when I try and kill the procedure, the process frequently oozes into a KILLED/ROLLBACK state from which there seems to be no return. From Google I have learned to do an sp_lock, find the spid, and then kill it with KILL <spid>. But when I try to kill it, it tells me SPID 75: transaction rollback in progress. Estimated rollback completion: 0%. Estimated time remaining: 554 seconds. I did find a forum message hinting that another spid should be killed before the other one can start a rollback. But that didn't work for me either, plus I do not understand, why that would be the case... could it be because I am recursively calling my own stored procedure? (But it should be having the same spid, right?) In any case, my process is just sitting there, being dead, not responding to kills, and locking the table. This is very frustrating, as I want to go on developing my queries, not waiting hours on my server sitting dead while pretending to be finishing a supposed rollback. Is there some way in which I can tell the server not to store any rollback information for my query? Or not to allow any other queries to interfere with the rollback, so that it will not take so long? Or how to rewrite my query in a better way, or how kill the process successfully without restarting the server?

    Read the article

  • Keep hover state applied until user mouses over another element.

    - by Thomas
    First let me state that I'm a jquery noob, so this may not make a lot of sense. So I have a series of list items that expand to show a hidden div inside if the user mouses over a link inside the item (not the whole list item itself) The problem is that if the users mouse leaves the link the li closes up again. I need this to work in a way so that the li only closes if you mouse over a link in another li. (sorry this is kind of hard to put into words) Heres my code. $(document).ready(function(){ $(".home_upcoming_title").hoverIntent({ over: makeTall, timeout: 500, out: makeShort }); }); // close document.ready function makeTall(){$(this).parents("li").animate({"height":200},200);} function makeShort(){$(this).parents("li").animate({"height":32},200);} and the HTML <li class="p1"> <ul class="home_upcoming_list2" id="fade"> <li class="home_upcoming_date">Sat.Sept.23rd.2010</li> <li><a href="./." class="home_upcoming_title" >Event Title</a></li> <li class="home_upcoming_city">Los Angeles</li> <li class="home_upcoming_type">Festival</li> <li class="home_upcoming_venue">Venue</li> <li class="home_upcoming_age">18+</li> <li><a href="./." title="Buy Tickets" class="home_upcoming_tix">Buy Tickets</a></li> <li><a href="./." class="upcoming_info" title="View Details"></a></li> </ul> <div style="height:150px; background-color:#FF0000; display:block;" class="sl0w"></div> </li> so the link with the class "home_upcoming_title" expands li to show the div inside but when I mouse over the div itself the list closes. I also need it so only the class "home_upcoming_title" expands the div. but it needs to stay open until you mouse over another link with the same class. sorry if that doesn't make much sense :)

    Read the article

  • Why doesn't C# allow for global inferred types i.e. using var?

    - by BritishDeveloper
    I know it can't be done since using var can only be done for local variables. I'm just wondering if anyone has a theory why the C# team thought this should be so. e.g. what would be wrong with this: public class SomeClass { var someString = "hello"; //not cool public SomeClass() { var someOtherString = "hello"; //cool } } If someString is initialised then it is obviously a string just like someOtherString. Why is there one rule for local variables and another for globals?

    Read the article

  • how to make variables in pre_controller hooks global to all controllers?

    - by ajsie
    in my pre_controller hook i have this code for doctrine: $manager = Doctrine_Manager::getInstance(); $conn = Doctrine_Manager::connection($db[$active_group][‘dsn’]); then in my controller i have this code to use doctrine connection i’ve created: $conn-export-createTable(‘test’, array(‘name’ = array(‘type’ = ‘string’))); $conn-execute(‘INSERT INTO test (name) VALUES (?)’, array(‘jwage’)); but $conn is undefined so it wont work. if i put the code in the pre_controller hook it will work. how can i make variables i declare in hooks available for all controllers so that i dont have to create a new connection all the time?

    Read the article

  • QLocale, what is the scope of the global QLocale::setDefault()?

    - by ALoopingIcon
    Problem: I have a QT based multiplatform (win,mac,*nix) application that parses ascii files containing decimal numbers. parsing is done using a variety of different code pieces that use anything from qt string stuff, c++ stdin, oldstyle scanf, etc. ascii files have always the '.' (dot) as separated decimal (e.g. in the file to be parsed 1/10 is written 0.1 as standard in many countries). people using the application within a OS localized for using comma separated decimal encounter a lot of problems (e.g. for french users scanf expect to find 0,1 as a valid textual representation of 1/10 and if they find 0.1 scanf will parse it as 0) How can I be sure that the OS Locale indication of how decimal point has to be written is always ignored? Is it safe assuming that adding QLocale::setDefault(QLocale(QLocale::English,QLocale::UnitedStates)); is enough to get rid of all these problems? Any suggestion for portable ways of setting the locale globally?

    Read the article

  • systemstate dump ??

    - by JaneZhang(???)
            ???????????????hang????,????????systemstate dump?????????,?????,????????,???????????????,????systemstate dump?????????????       ??????,????????systemstate dump, ?????“WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK”?        systemstate dump???????????,??????:??????,???????,????dump????????,???????M????)1. ?sysdba???????:$sqlplus / as sysdba??$sqlplus -prelim / as sysdba <==??????????hang?????SQL>oradebug setmypidSQL>oradebug unlimit;SQL>oradebug dump systemstate 266;?1~2??SQL>oradebug dump systemstate 266;?1~2??SQL>oradebug dump systemstate 266;SQL>oradebug tracefile_name;==>????????2. ????systemstate dump,??????hang analyze??????????????????$sqlplus / as sysdba??$sqlplus -prelim / as sysdba <==??????????hang?????SQL>oradebug setmypidSQL>oradebug unlimit;SQL>oradebug dump hanganalyze 3?1~2??SQL>oradebug dump hanganalyze 3?1~2??SQL>oradebug dump hanganalyze 3SQL>oradebug tracefile_name;==>??????????RAC???,????????????systemstate dump,???????????(?????????):$sqlplus / as sysdba??$sqlplus -prelim / as sysdba <==??????????hang?????SQL>oradebug setmypidSQL>oradebug unlimitSQL>oradebug -g all dump systemstate 266  <==-g all ??????????dump?1~2??SQL>oradebug -g all dump systemstate 266?1~2??SQL>oradebug -g all dump systemstate 266?RAC???hang analyze:SQL>oradebug setmypidSQL>oradebug unlimitSQL>oradebug -g all hanganalyze 3?1~2??SQL>oradebug -g all hanganalyze 3?1~2??SQL>oradebug -g all hanganalyze 3?????????????????systemstate dump,?????????????backgroud_dump_dest??diag trace???????????????????????????,?????hang?,?????systemstate dump?????:10:   dump11:   dump + global cache of RAC256: short stack (????)258: dump(???lock element) + short stack (????)266: 256+10 -->short stack+ dump267: 256+11 -->short stack+ dump + global cache of RAClevel 11? 267? dump global cache, ??????trace ??,??????????????,????????,???266,??????dump?????????,????????????????????short stack????,???????,??2000???,??????30??????????,????level 10 ?? level 258, level 258 ? level 10????short short stack, ??level 10?????lock element data.?????systemstate dump???,??????level?????:??????37???:-rw-r----- 1 oracle oinstall    72721 Aug 31 21:50 rac10g2_ora_31092.trc==>256 (short stack, ????2K)-rw-r----- 1 oracle oinstall  2724863 Aug 31 21:52 rac10g2_ora_31654.trc==>10    (dump,????72K )-rw-r----- 1 oracle oinstall  2731935 Aug 31 21:53 rac10g2_ora_32214.trc==>266 (dump + short stack ,????72K)RAC:-rw-r----- 1 oracle oinstall 55873057 Aug 31 21:49 rac10g2_ora_30658.trc ==>11   (dump+global cache,????1.4M)-rw-r----- 1 oracle oinstall 55879249 Aug 31 21:48 rac10g2_ora_28615.trc ==>267 (dump+global cache+short stack,????1.4M) ??,??????dump global cache(level 11?267,???????????????)??????????,?????????systemstate dump ??

    Read the article

  • How do I fix my Unit Test to have global access to everything?

    - by SLC
    Usually when you add one (in Visual Basic), it pops up a message asking if you want to enable an option that lets the test access things like private methods etc. However, I am editing a solution that does not have this enabled. I'd like to enable it so my unit tests will work, but I can't find the setting. Can anyone tell me how to enable it after the project has been created?

    Read the article

  • Not sure what happens to my apps objects when using NSURLSession in background - what state is my app in?

    - by Avner Barr
    More of a general question - I don't understand the workings of NSURLSession when using it in "background session mode". I will supply some simple contrived example code. I have a database which holds objects - such that portions of this data can be uploaded to a remote server. It is important to know which data/objects were uploaded in order to accurately display information to the user. It is also important to be able to upload to the server in a background task because the app can be killed at any point. for instance a simple profile picture object: @interface ProfilePicture : NSObject @property int userId; @property UIImage *profilePicture; @property BOOL successfullyUploaded; // we want to know if the image was uploaded to out server - this could also be a property that is queryable but lets assume this is attached to this object @end Now Lets say I want to upload the profile picture to a remote server - I could do something like: @implementation ProfilePictureUploader -(void)uploadProfilePicture:(ProfilePicture *)profilePicture completion:(void(^)(BOOL successInUploading))completion { NSUrlSession *uploadImageSession = ..... // code to setup uploading the image - and calling the completion handler; [uploadImageSession resume]; } @end Now somewhere else in my code I want to upload the profile picture - and if it was successful update the UI and the database that this action happened: ProfilePicture *aNewProfilePicture = ...; aNewProfilePicture.profilePicture = aImage; aNewProfilePicture.userId = 123; aNewProfilePicture.successfullyUploaded = NO; // write the change to disk [MyDatabase write:aNewProfilePicture]; // upload the image to the server ProfilePictureUploader *uploader = [ProfilePictureUploader ....]; [uploader uploadProfilePicture:aNewProfilePicture completion:^(BOOL successInUploading) { if (successInUploading) { // persist the change to my db. aNewProfilePicture.successfullyUploaded = YES; [Mydase update:aNewProfilePicture]; // persist the change } }]; Now obviously if my app is running then this "ProfilePicture" object is successfully uploaded and all is well - the database object has its own internal workings with data structures/caches and what not. All callbacks that may exist are maintained and the app state is straightforward. But I'm not clear what happens if the app "dies" at some point during the upload. It seems that any callbacks/notifications are dead. According to the API documentation- the uploading is handled by a separate process. Therefor the upload will continue and my app will be awakened at some point in the future to handle completion. But the object "aNewProfilePicture" is non existant at that point and all callbacks/objects are gone. I don't understand what context exists at this point. How am I supposed to ensure consistency in my DB and UI (For instance update the "successfullyUploaded" property for that user)? Do I need to re-work everything touching the DB or UI to correspond with the new API and work in a context free environment?

    Read the article

  • Local Variables take 7x longer to access than global variables?

    - by ItzWarty
    I was trying to benchmark the gain/loss of "caching" math.floor, in hopes that I could make calls faster. Here was the test: <html> <head> <script> window.onload = function() { var startTime = new Date().getTime(); var k = 0; for(var i = 0; i < 1000000; i++) k += Math.floor(9.99); var mathFloorTime = new Date().getTime() - startTime; startTime = new Date().getTime(); window.mfloor = Math.floor; k = 0; for(var i = 0; i < 1000000; i++) k += window.mfloor(9.99); var globalFloorTime = new Date().getTime() - startTime; startTime = new Date().getTime(); var mfloor = Math.floor; k = 0; for(var i = 0; i < 1000000; i++) k += mfloor(9.99); var localFloorTime = new Date().getTime() - startTime; document.getElementById("MathResult").innerHTML = mathFloorTime; document.getElementById("globalResult").innerHTML = globalFloorTime; document.getElementById("localResult").innerHTML = localFloorTime; }; </script> </head> <body> Math.floor: <span id="MathResult"></span>ms <br /> var mathfloor: <span id="globalResult"></span>ms <br /> window.mathfloor: <span id="localResult"></span>ms <br /> </body> </html> My results from the test: [Chromium 5.0.308.0]: Math.floor: 49ms var mathfloor: 271ms window.mathfloor: 40ms [IE 8.0.6001.18702] Math.floor: 703ms var mathfloor: 9890ms [LOL!] window.mathfloor: 375ms [Firefox [Minefield] 3.7a4pre] Math.floor: 42ms var mathfloor: 2257ms window.mathfloor: 60ms [Safari 4.0.4[531.21.10] ] Math.floor: 92ms var mathfloor: 289ms window.mathfloor: 90ms [Opera 10.10 build 1893] Math.floor: 500ms var mathfloor: 843ms window.mathfloor: 360ms [Konqueror 4.3.90 [KDE 4.3.90 [KDE 4.4 RC1]]] Math.floor: 453ms var mathfloor: 563ms window.mathfloor: 312ms The variance is random, of course, but for the most part In all cases [this shows time taken]: [takes longer] mathfloor Math.floor window.mathfloor [is faster] Why is this? In my projects i've been using var mfloor = Math.floor, and according to my not-so-amazing benchmarks, my efforts to "optimize" actually slowed down the script by ALOT... Is there any other way to make my code more "efficient"...? I'm at the stage where i basically need to optimize, so no, this isn't "premature optimization"...

    Read the article

  • does a git repository have its own local value for core.autocrlf that overrides the global one?

    - by Warren P
    As per this question, I understand that core.autocrlf=true in git will cause CRLF to LF translations. However when I type : git config core.autocrlf I see: false However, when I stage modified files that are already in the repo, I still get these warnings: Warning: CRLF will be replaced by LF in File1.X. The file will have its original line endings in your working directory. My guess is that the repo copy of the file is already set to "autocrlf=true". Questions: A. How do I query whether a file or git repo is already forcing AutoCrlf? B. How do I turn it autocrlf off?

    Read the article

  • How to prevent VC++ 9 linker from linking unnecessary global variables?

    - by sharptooth
    I'm playing with function-level linking in VC++. I've enabled /OPT:REF and /OPT:ICF and the linker is happy to eliminate all unused functions. Not so with variables. The following code is to demonstrate the problem only, I fully understand that actually having code structured that way is suboptimal. //A.cpp SomeType variable1; //B.cpp extern SomeType variable1; SomeType variable2; class ClassInB { //actually uses variable1 }; //C.cpp extern SomeType variable2; class ClassInC { //actually uses variable2; }; All those files are compiled into a static lib. The consumer project only uses ClassInC and links to the static library. Now comes the VC++ 9 linker. First the linker sees that C.obj references variable2 and includes B.obj. B.obj references variable1, so it includes A.obj. Then the unreferenced stuff elimination phase starts. It removes all functions in A.obj and B.obj, but not the variables. Both variable and variable2 are preserved together with their static initializers and deinitializers. That inflates the image size and introduces a delay for running the initializers and deinitializes. The code above is oversimplified, in actual code I really can't move variable2 into C.cpp easily. I could put it into a separate .cpp file, but that looks really dumb. Is there any better option to resolve the problem with Visual C++ 9?

    Read the article

  • Is this the right way to have "global" parameters for my servlets?

    - by Geo
    If I have: <context-param> <param-name>SomeParam</param-name> <param-value>SomeValue</param-value> </context-param> in my web.xml, is this the servlet way of specifying options ( like in the way a config file is used ) , or am I doing something wrong? I know about init-param that can be specified for a servlet, but I'd like o make sure some values are the same for all the servlets.

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >