NSOperationQueue. How many active operations in progress?

Hello,
I am using NSOperationQueue for my threading and have setMaxConcurrentOperationCount: NSOperationQueueDefaultMaxConcurrentOperationCount so that the Queue itself decides how many threads are used based on available resources.
How do I know exactly how many active operations there are at certain time?
-maxConcurrentOperationCount returns -1
[operations count] returns the number of operations added to array - not how many of them are active
Do I need to manually iterate and ask each operation if it's active or is there some faster way?
Thanks.
-Mike

Depending on your needs you could :
- poll each operation when needed
- alternatively you may observe the isExecuting property to be notified immediately in case of change.

Similar Messages

  • Is there a way of finding out how many active hours you've worked on a Premiere project?

    If not, it'd be a very cool addition for Adobe to implement... so you know exactly how many hours a project is taking (and how much to charge clients etc.) Obviously we're all prone to leaving Premiere on and wandering away, so I guess it would need to be able to differentiate between active and non-active time...

    Is there a way of finding out how many active hours you've worked on a Premiere project?
    There are two things a client get's billed for, my time, and my computer's time.  If either one of us are working on a project, the client get's billed.  Even if Adobe spent (wasted?) time on adding such a feature, they'd never be able to include any time I've spent working on the project with PP closed, so this feature would have very, very, VERY limited usefulness.
    The method suggested by the images is still the best way.

  • Counting how many active sessions in a webapp

    Hi folks,
    I was wondering if it is possible to count how many active sessions that there currently are in a webapp? I've looked at the ServletContext and ServletConfig classes, but I can't find anything. Any ideas?
    Cheers,
    Raj.

    HttpSessionListener was introduced in servlet spec 2.3 which is supported in Tomcat 4.0 but not 3.3.
    If upgrading to 4.0 is not an option, there is no elegant way to get what you need. There is no API call that returns all the active sessions so you must do it yourself. One way is to create a class that implements HttpSessionBindingListener to track your sessions. Instantiate it on start-up and add its reference as a session attribute when the session is first created. You can then update your custom session info in the valueBound and valueUnbound methods.

  • How to active Operator Logo?

    Hi,
    How to Active Operator Logo In My Nokia C2-01.
    Someone tell me please.

    question answered already here: http://discussions.nokia.com/t5/Xseries/Nokia-C2-0​1-How-to-Active-Operator-logs/td-p/1697264

  • Nokia C2-01 How to Active Operator logs?

    I'm Sudip from Silchar
    I want to active Operator logs in My Nokia C2-01
    How to active Operator Logs? Tell Me Quickly.
    Solved!
    Go to Solution.

    Look in display settings if its there and greyed out its not possible this way,or you can google OPERATOR LOGO and your phone plenty of help there.
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Connection Pooling: how many active connections?

    Hi, everybody.
    I have a very simple question about connection pooling...
    How many active connections should a database see once a connection pool has been opened?
    I mean, it should see only one connection (the pool itself) at any time, or the number of "logical" active connections in that moment?
    Thanks for any answer.

    Sorry...
    This is the wrong forum, I posted again my question in the JDBC Forum...

  • How to query in SCCM 2012 to know how many active and inactive clients in a specific time and date

    Dear Everyone,
    Good morning. I need to perform a query to know how many clients PCs are active or inactive during the a specific time and date (let say, today 9pm). In my query, I want to know:
    1. How many client PCs is active at that time and date?
    2. How many client PCs is not inactive at that time and date?
    Any assistance is greatly appreciated. Thanks.

    Thank you Gerry for pointing out that it doesn't show real time date. I do agree with that. However, I am look at the (at least in this) report which supposed to [description] shows a list of computers not reporting any power activity for a specified date
    and time. Since I can only key in date in my selection (time option not given), I am expecting the report to show me whether there any client PCs that doesn't any power activity for the specified date. A list was generated, and a number of them shows HardwareInventoryScan,
    LastHeartBeatScan and LastPolicyRequest on the same date itself. I would like to know why these appears, so that I can learn from it.
    Due to the selection option given, I can't expect my original goal, but at least (hopefully) I can get to know (past event) how many and which client PCs is not powered on a particular date based on the date and collection selected.
    At least by getting explainations, I hope to learn something from this (how to read this report). Thanks in advance.

  • How many active threads in JVM?

    HI,
    Is there a way to find out all the running/active/blocked/unknown threads in a JVM?
    Doesn't matter if it is through code or some external command.
    I use jdk1.4 on Red Hat Linux.
    Thanks and Regards
    suri

    HI,
    Is there a way to find out all the
    running/active/blocked/unknown threads in a JVM?
    Doesn't matter if it is through code or some external
    command.
    I use jdk1.4 on Red Hat Linux.
    Thanks and Regards
    suri'jdb' tool lets you know how many threads exist in an application. try these command
    compile your program with '-g' option.
    jdb <classname>
    stop at <classname>:<line no of main(){}>
    run
    threads
    You can notice four threads. But I guess in linux, it might show lots of verbose with thread ID, If possible pls post the result for us to see.

  • How many activations are allowed with Premiere Pro?

    How many computers can Premiere Pro CS4 be installed on before you have to buy additional user licensing?

    What if a person has Production Studio CS2. Due to a major crach the suite has to be installed again.
    AE is greyed out and Adobe cant help to get it working and also told this person he had only two activations left.

  • Determine how many activations I have left on a 10 managed systems license

    I just purchased Apple Remote Desktop 3 from Amazon.com. It was used. I do I determine how many license I have left with the serial number? How do I disable the other computers, should there be any, from the previous owner? Russ

    Russ
    I think you may be slightly confused about how the 10-Client license works? Basically you can only manage and 'see' 10 client workstations when using ARD from an administrator's workstation.
    The serial number itself (or if you like its license) is used when launching ARD for the first time on a workstation you decided to install it on. It only applies to that workstation. You key it in when prompted. The license is not installed or used in any way AFAIK on any workstation you decide to control/observe/manage.
    Tony

  • My macbook is slow to start up. How many active processes on startup

    Hi,
    My Macbook pro is getting so much slower to start up.
    I've just done a macscan and it shows 87 processes at startup.
    Is this the reason for the slowness??

    Things That Can Keep Your Computer From Slowing Down
    If your computer seems to be running slower here are some things you can do:
    Boot into Safe Mode then repair your hard drive and permissions:
    Repair the Hard Drive and Permissions Pre-Lion
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Repair the Hard Drive - Lion
    Boot from your Lion Recovery HD. When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Restart your computer normally and see if this has helped any. Next do some maintenance:
    Suggestions for OS X Maintenance
    For situations Disk Utility cannot handle the best third-party utility is Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts was significantly reduced since Tiger.  These utilities have limited or no functionality with Snow Leopard or Lion and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems. For more about malware see Macintosh Virus Guide.
    I would also recommend downloading a utility such as TinkerTool System, OnyX 2.4.3, or Cocktail 5.1.1 that you can use for periodic maintenance such as removing old log files and archives, clearing caches, etc.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the command line.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. There is no confirmation that this version also works with Lion.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    SuperDuper!
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.
    Additional Hints
    Be sure you have an adequate amount of RAM installed for the number of applications you run concurrently. Be sure you leave a minimum of 10% of the hard drive's capacity as free space.
    Add more RAM. If your computer has less than 2 GBs of RAM and you are using OS X Leopard or later, then you can do with more RAM. Snow Leopard and Lion work much better with 4 GBs of RAM than their system minimums. The more concurrent applications you tend to use the more RAM you should have.
    Always maintain at least 15 GBs or 10% of your hard drive's capacity as free space, whichever is greater. OS X is frequently accessing your hard drive, so providing adequate free space will keep things from slowing down.
    Check for applications that may be hogging the CPU:
    Open Activity Monitor in the Utilities folder.  Select All Processes from the Processes dropdown menu.  Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time, then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Often this problem occurs because of a corrupted cache or preferences file or an attempt to write to a corrupted log file.

  • In Creative cloud for teams, how many activations per license?

    Just want top make sure I purchase the correct number of licenses for my team.

    Hi Peter,
    Every license permits 2 activations.
    You can install and activate the license on 2 machines.
    Regards,
    Sheena

  • Why doesn't iCal print "Lists" in order, still, after how many different operating systems, and now with Lion?

    I can't believe iCal List printing is still unsorted - HOW HARD CAN THIS BE TO FIX APPLE ?!!!!?

    (bump)

  • How many computers can I store my iTunes library on?

    I vaguely recall reading somewhere that I can put my iTunes library on up to five different computers. Since I first created my library, I've had to change laptops a few times (changed companies, laptop stolen, etc).
    Can I keep downloading iTunes software to my new laptop, and transfering my songs into the libary (backed up on external hard drive)? Or will I run into a limit?
    I only need one, perhaps two, laptops to actively use the library. So if there's a limit on how many active laptops you can have, I'm not sure how to make an old laptop unactive.
    Thanks.

    You can put the music on as many computers as you want. However, you can only use it on 5 "active" computers max at one time.
    You cannot individually unauthorize computers you no longer have.
    About iTunes Store authorization and deauthorization

  • How to get real time information about how many user are logged in and thei

    I use tomcat as my server platform in Ubuntu for a war file.
    I know in order to get real time information about how many user are logged in, we can count how many active sessions exist by a SessionCounter code. However, I have to permit HttpSessionListener in web.xml of tomcat. From other users' experiences, the configuration is complexed and has some errors.
    Here's the link:http://www.stardeveloper.com/article...1112001&page=1
    In order to get users' ip, in jsp, use request.getremotehost() or
    request.getremoteaddress() by editing the jsp file.
    I wonder if there's some open source software to use for these two purposes.
    Thank you!

    That url is missing a few bits. The ... in the middle doesn't help.
    we can count how many active sessions exist by a SessionCounter code.
    However, I have to permit HttpSessionListener in web.xml of tomcat.
    From other users' experiences, the configuration is complexed and has some errors.And have you tried it? The configuration isn't that complex.
    What errors do you mean? Errors in tracking people, variance in the count? Probably related to internet issues and nothing you can do will alleviate them.

Maybe you are looking for

  • Xp_logininfo "Installation problem on windows 2003 with Sql 2005"

    Hi every one I am facing a problem during the installation of Solution Manager 4.0 on Windows 2003 server with Ms Sql 2005, I received the following error Msg 15404, Level 16, State 19, Procedure xp_logininfo, Line 60. Its some how look likes that th

  • XML Publisher for CJK Support

    Hi, How to make xml publisher support cjk characters in pdf format? In xml publisher template tab, I can preview my report in html/excel/rtf formats correctly, but in pdf format cjk characters become '?????'. It seems like some fonts for pdf are miss

  • No sound!!! everything else is fine....

    ok i just noticed that my ipod loses its sound every once in a while for no particular reason.... i mean i play the music it says its playing but no sound i checked everything and and still no luck. i even restored my ipod and still nothing but the w

  • Formating HD and keeping iPhoto Library

    Hi, I want to format my Macbook's HD and do clean install of OSX, but I'm worried about iPhoto. I want to keep all my photos (obviously!), but I also want to keep them organised in their iphoto albums. If I just copy my 'iPhoto Library' folder to an

  • DW CS3 Locking up

    Frustration aside... At first I was unable to make dreamweaver open at all. SO would up uninstalling all older versions of DW and reinstalling CS3 and now it opens. However... I have periodic hangs in the application while using it. Examples: - Scrol