New to multithreading, would like some advice
Hi guys, I currently have a project which runs in single thread mode but im thinking of implementing multi threading and im wondering if its actually worth doing. Within the project i have a group of objects held in a hash map, when any of the objects are due for an update, an update request calls a single thread which retrieves the object from the hashmap and modifies it. My plan is to create a thread pool which will handle all the update requests independently.
So assume i have three objects in my hashmap A, B and C (in reality this could be 20-50 objects), and update request comes in for object A, A is retrieved from the hashmap and modified. Whilst A is being updated no other update request can access A but update requests for B and C should be executed. Assuming i may have hundreds of update requests every 10 seconds for example would i benefit alot from multithreading? and if so what type of collection would you recomend?
Ninet wrote:
Hi guys, I currently have a project which runs in single thread mode but im thinking of implementing multi threading and im wondering if its actually worth doing. That is a good question.
Within the project i have a group of objects held in a hash map, when any of the objects are due for an update, an update request calls a single thread which retrieves the object from the hashmap and modifies it. My plan is to create a thread pool which will handle all the update requests independently. In which case you may need a thread pool and a ConcurrentHashMap.
So assume i have three objects in my hashmap A, B and C (in reality this could be 20-50 objects), and update request comes in for object A, A is retrieved from the hashmap and modified. Whilst A is being updated no other update request can access A but update requests for B and C should be executed. Assuming i may have hundreds of update requests every 10 seconds for example would i benefit alot from multithreading? Provided there is not much contention it sounds ideal.
and if so what type of collection would you recomend?ConcurrentHashMap. However it sounds like it would be simplest if the values are not replaced you can use this as your lock as well.
Similar Messages
-
New to Breeze, would like some helpful info
I have a java web application built with structs. My clients
wants the ability to upload online exam and someone recommended me
look into 'Adobe Breeze' for this. I am totally new to Adobe
Breeze, I will do research, but can anyone with experience with
Breeze give me some info or feasibility on using this product with
my app?
Maybe some sites linking JAVA with Breeze?
Thanks so much,
CMeg-
I had to go out of town for a family emergency. I really want to get an iPod but the first 2 I had I broke and could never figure out how to get the songs on the iPod. it seems some songs I purchased fro iTunes will download and play but some will not I would like to know all the places I can get songs to play on my iPod (well, when I get one tat will work for me). I have a lot of CDs, should I get them on iTunes first. Do I look for other type of songs in various formats to install in the iPod like…oh, what are some of the formats that music can be downloaded in? mp4 all the various types I am sure you know what I am getting at.
I want the classic but I am nervous being an exerciser. I do not care for videos but if the classic allows one to play them that is OK.
I would like you to look at this ear plug store online that sell to artists for their recording, heavy duty iPod users, runners, etc. I need an awesome ear plug that will take the music to the next level but I have no idea what type will be best for me.
Let me see if I can find that website. It was something like earphone Solutions but it might not be the exact one. They have a lot of the same ear plugs.
But back to what iPod and where I can get the music. That is what I need help with ow. I do not want to pay for whole CDs, but songs that are good to workout to.
If you get a chance and look at tat ear plug website and give me your opinion on ear plugs. This is where I am lost but need a much better ear plug and one that will stay in my odd shaped ears.
Thanks for waiting. I am still with my pops in the hospital most of the time but I will get back to you.
Blessings -
Would Like Some Advice/Help on How to Start Backing-Up...
Hey-
I am getting a new MBP 17" for architecture/city planning grad school so I needed a lot that the 17" MBP had. I am not too excited carrying it around campus unless somebody rally turns me on t a nice bag to carry it in.
what I really am here for, because I have never backed up before, is to start learning about backing up. I do not want to pay $100/yr. for MobileMe and I think to use an external drive seems the most practical-except I am really hard on stuff so I would need a heavy duty case. Also, the FW 800 for the CAD program and other 3D programs (forget that, the school pays for those.)
I understand there are basically (minus the DVDs, CDs) 2 main ways to back up and they are archival and clonal. Anybody have any feeling on one way or the other? I am tending to go with the one that will not require another purchase of a program (the clonal system). But as you can tell I have very little experience with this backing up part. what happened to the ones that did not produce tapes which had many if any moving parts? The less moving part in this type of stuff think the better, but who am I you all are saying, hey?
Any help would be appreciated. I am looking for the top of the line headset for the MBP when I am trying to study I need or do better with some good jazz or Blues tune in the background and the speakers for the MBP will be mini ( I saw a small black pair in the Apple Store the other day) and a great ear phones for an iPod for exercise. I am looking at the iPod Classic but I hear it has a moving drive so if that is true, I better look for something else like the Touch. Anybody have trouble with the iPod Classic skipping when they were lifting weights, doing flexibility and some cardio like the Precore elliptical or something not too hard on the joints?
Any recommendations in these areas would be greatly appreciated.
FondlyHi One2Two,
For a backup drive I'd be looking at something like THESE in the 750 to 1.5 TB range with the "Quad" interface if you are going to be needing space for CAD files etc .
These are very good enclosures, run cool and quiet (no fan needed). I have several of the equivalent model sold in Australia (under a slightly different name) and they have proved faultless. Very well built, a little larger than some other options, but extremely reliable. I cart one or two of mine around on rough bush roads in the Australian outback fairly regularly (I'm an anthropologist) It is also easy to simply upgrade the internal drive at a later date.
For software, in the first instance, you can't go past SuperDuper - http://www.shirt-pocket.com/SuperDuper/
This lets you create a bootable clone of your HD and then easily update it either manually or through an automated schedule. Probably the most popular backup software amongst the "Level 4's" and "Level5's" on the Apple boards if recent discussions are anything to go by.
Many of us , though , complement it with an additional backup using Apple's own "Time Machine" (which will come free with your computer), either to a second drive, or , a little less safely, on a second partition of the same drive used for SuperDuper.
Time Machine essentially creates a quasi "archival" style backup - letting you revert to earlier versions of files etc over a period determined by your available disc space.
The combination of the two is pretty hard to beat.
The free version of SuperDuper will create your first clone, and you can continue to use it, but the "shareware" version is the one you want. It is not at all expensive and does a brilliant job.
Cheers
Rod -
Just bought myself a JamPack and would like some advice on installing...
In the form of the Symphony JamPack. It was quite a fleeting idea, and I just went in and picked it up from the Apple Store. I see it needs 10 GB... This is just for my MacBook, so really just for self amusement, and I'm running lowish on HD space. I don't care at all about the loops, does anyone know how much space it would give me to get rid of them? Also, any efficient ideas on how not to install them at all? Or do I need to fully install and then delete afterwards.
I can tell I'm not going to get much sleep tonightHi Freddie,
I have that jam pack and think it is an incredible value.
About your situation, I can't recall if there is a custom install option in the Installer. That would be the first place I would look if I were you. If there's not, then you will probably have to install everything and delete the ones you don't want, like you surmised. And don't forget to have about 20% of your hard drive as free space......
X -
I have a macbook pro mid 2010 17'' 2.66 i7 looking to put a new hard drive in it something like a 250 gb , orig drive 500 gb 5400 toshiba but i don;t really need that much space so i would like some input, type,speed,brand,compatibly,noise Thank You!!
There's no reason to install a smaller hard drive. In some cases, it may decrease performance.
Your MacBook Pro comes with a 5400 rpm hard drive, so what you can do is to install a smaller, 7200 rpm hard drive, so you will get a better performance. Any 2'5" SATA hard drive will work, but you can have a look at OWC for hard drives > http://eshop.macsales.com/shop/hard-drives/2.5-Notebook/
HGST and Seagate hard drives have a good reputation, so you can purchase one of them -
I have a new iphone5 and would like to have my own itunes list away from the familys itune list
i have a new iphone5 and would like to have my own itunes list away from the familys itune list?
i have now got my own apple id account but where do i go from here?
thanks danny.The user data is store in the profile folder. You can copy the data manually by copying the contents of the profile folder, for details see [http://kb.mozillazine.org/Profile_backup Profile backup - MozillaZine Knowledge Base] or [[Backing up your information]].
There are some add-ons and utilities that can make this process easier. The first one is the [https://addons.mozilla.org/en-US/firefox/addon/2109/ FEBE] add-on which can be used to copy a profile. Another option is the free [http://mozbackup.jasnapaka.com/ MozBackup] utility. -
I would like some help in determining the proper structure/implementation
I would like some help in determining the proper structure/implementation for the following scenario:
I have ~10 steel rods that have been equipped with a strain gauge. The most I would have is ~30 steel rods.
Each setup has had a 10 point calibration done.
These steel rod/strain gauge setups are assigned a calibration number.
The data would be grouped for each steel rod and identified by the calibration number.
I would like to use that calibration data to determine the Young’s Modulus for each steel rod and store that within the specific rod’s information.
I want the user to be able to add new steel rods dynamically and the Young’s Modulus calculated and stored with it.
There are two different types of rods.
The cross-sectional area of the rod needs to be stored and that value is constant based on the rod type (so there are two different area values).
After a rod’s calibration data is entered the first time, the data should be static so it doesn’t need to be re-entered.
The user would enter the cal#, the 10 point calibration data, and the rod type.
The user will only see the steel rod cal# on the FP.
I am using a queue-based producer/consumer with event structure for the front panel interface. So I’m thinking whenever a rod cal# was added I would call a subvi where the calibration data can be entered and then the Young’s Modulus could be calculated and stored. An option to edit/review existing cal data should be available.
LabVIEW 2010, Win 7.
My initial idea was:
Rod Arr – array of clusters:
Rod Info - cluster:
Calibration number – string
Rod Scale cluster:
mV/V – double array
force – double array
Young’s Modulus – double
Rod type – enum
Cross-sectional area – double
I have not implemented this because I’m not sure how to implement that AND keep the data after it’s been entered. And all of the bundling/unbundling anytime I want to access/edit any rod information can be BD consuming. I thought a lookup table might work. When I looked on the forums for a lookup table I was pointed in the direction of arrays/clusters.
So I have two questions:
What would be the best structure for the steel rod data?
What would be the best data type for the calibration# that the user can edit (enum, ring, ?)?I would make a couple of small change to your proposed data layout (highlighted in blue):
Rod Arr – array of clusters:
Rod Info - cluster:
Calibration number – string
Array of Rod Scale cluster:
mV/V – double
force – double
Young’s Modulus – double
Rod type – enum
Cross-sectional area – double
For the calibration data, I would have an array of clusters rather than a cluster of arrays. IMHO, this makes it easier to index through the calibration points, and makes it less likely you will ever have a situation where you don't have the same number of mV/V and force points. I'd also move the Young's modulus, type, and area info into the Rod Info cluster.
I prefer to store this type of configuration in the system registry, but that is more complicated and far from universal in the LabVIEW world. A simpler way would be to simply pass the entire array to the "write to binary file" function. If you do this, however, you might want to add a version number, otherwise it will be very difficult to maintain backwards compatibility if you ever need to change the data structure.
As far as the control type, it depends on what the user is entering. If the user is mostly entering calibration numbers already in the system, I would use a (system) combo box. This allows the user to select an existing calibration number from the menu, but also to enter a new calibration number if they need to. If the user will almost always enter new calibration numbers, then I would use a standard string control. Either way, you'll probably want to validate the format of the number the user enters.
Mark Moss
Electrical Validation Engineer
GHSP -
I have a new iMac and would like to buy a cheap legal version of Photoshop to create a simple flyer. If I look on ebay or similar, what version do I require?
I understand that Photoshop 5 is not compatible?
I used to use CS5 at work which was very good, doing a little reserach it appears as if this suite has been replaced by a monthly 'cloud' charge which for me as a basic home user is unnecessary.
Appreciate any help.Hello Simonlala;
Anyone that buys an iMac should not have to buy "cheap". it's like putting "retread tires" on a brand new Farrari! Ugh!
To find a cheap version of PS is to locate an obsolete version only? Software surplus business may have some or check the obituary columns to see if any Photographers or Gaphic Designers have left some things behind?
Some options...enroll in a community college Multimedia class and you will not only have access to Photoshop, you'll have access to much more software for the price of the course. It will also qualify you as a student and you can get a discounted rate on the Adobe Creative Cloud subscription as well.
If you are only making "simple flyers" would not MS Word or OpenOffice software do the job for you? There are applications for that purpose and Photoshop is not the only way to skin this cat! Or you can always buy a box of Crayola's and make a pamphlet that way?
And as a bonus, you may learn something from the course you enroll in.
I am a student and subscribe to Adobe Creative Cloud...it's reasonable for my purposes for now. -
Good afternoon, I would like some information I have an ipod nano 6th generation and has the same one-year warranty is only 2 months of use, and it fell down and broke the glass of the display, I called technical assistance in Brazil and informed me that Brazil has no repair services for Apple, which was the basis of its price change in the exchange is not worth half the value of the product.
I wonder how I do to change this device without the expense of 50% for the same product is in warranty?
Thanks in advance.yes agree, plus a multinational seeing a product and has no technical assistance to do the maintenance then it's no use I buy a new product if it is damaged I will always be because it has no prejudice in this maintenance.
sorry but even more products coming from China to Brazil in technical assistance. -
Business Analyst in BI domain and would like some pointers..
Hi
I'm new to the world of Business Analyst in BI domain and would like some pointers..
- What/who is Business Analyst in Business Intelligence / Analytics and what are the roles and responsibilities?
- What key skills/background/knowledge is needed to succeed in this area?
- How does a workday day of BA in BI domain look like?
Please point to study resources on this topic
Thanks in advance to the experts.
Best,
DeepBtry Attending this free webinar by Rishikesh Vakula, a seasoned Project Manager and business analyst , with more than 13 years of experience in various domains, to include, Defense, Telecommunications, E Commerce, Government And Banking & Financial to understand the future of BI
Please register here - http://www.corp-corp.com/blog/it-business-analysis/?aid=orbacceforum
Wednesday, August 24, 2011 - 06.00 u2013 7.00 P.M EST
Webinar Highlights
u2022 Expectations from Todayu2019s IT Business Analyst
u2022 Waterfall Vs Agile Business Analysis
u2022 Artifacts from an IT Business Analyst
u2022 Introduction to IT Project Scope and Scope Management
u2022 Domain Modelling & Requirement Gathering
u2022 Practical aspect of Requirement Gathering -
With the previous version of Firefox for my mobile phone it had the gingerbread copy and paste system and now I am not able to do so at this point. I just want to know how to copy and paste with the new update version of Firefox for my mobile phone. I have a Samsung Infuse. I would like some input on this. Thank you and much appreciated.
Sorry, the new user interface in the latest update did not have selection/copying of text ready in time for its release. We're working on adding it back for an upcoming version very soon. If you'd like, you can already start testing it in our [https://wiki.mozilla.org/Mobile/Platforms/Android#Download_Nightly nightly development builds].
-
I would like to use touchsmart but know nothing about it and would like some training.
The machine comes with a large number of tutorials that you can learn with.
Between that and the documentation that it ships with you should have more than a few days of new things to learn. -
I had an iPAD 4. Since I updated to IOS 7 it began to freeze up. I now have the iPad Air and the same thing happens. I'd like some advice because apple's technical service has no idea.
Technical service in Spain is useless. They told me to re-install everything again as when it's brand new, application by application to see which one is failing. I have 150 applications.
If they continue in this direction they will end up like Palm
You can tell Steve Jobs is no longer in charge.
I'm thinking of moving to Samsung.If this problem continued across an iPad with Retina to an iPad Air it is almost definite it is one of your apps causing the problem. Run it for a day with no apps loaded on it, if it doesn't freeze then one of your apps that has not been updated is causing the issue. And the Technical Service in Spain gave you correct information.
It was no different when Mr. Jobs was still in charge (I was around for iOS 3.0) and it is no different on a Surface or a Note. -
I purchase a new computer and would like to have my iTunes Library that I have on my laptop on this computer as well as my laptop. I have installed iTunes, but I don't know how to copy the music to my new computer.
Type "move itunes library" into the google search bar
-
Need a little help my computer hard drive crashed and I bought a new computer and would like to retrieve my many songs that I paid for and upload them to my new computer how Retrieve my music t thank you
Either restore it from a backup, or use these instructions to redownload it through the iCloud.
(84741)
Maybe you are looking for
-
List of values not properly working in the selection screen.
Dear Mates, In BEx query all the selection parameters are working and showing all the list of values. Created the same report in crystal from BEx query, for one particular selection it is not showing the list of values or drop down. Just showing "DIS
-
Is it possible to use a part of the screen area
Maby a silly question, but has anyone an idea how to play a game for example on a partial area of the hugh 27inch screen? Is there a utility that places full screen applications like games within a window (games that don't have a window mode on its o
-
I am importing all of my music from my hard drive over into iTunes. I notice that it sorts it by artist, then by album, but then my track number. Is there any way to change it to where it sorts like the following: artist, album, song (in alphebetical
-
i need the os x mavericks download, im on mountain lion, and i wish to obtain mavericks on my computer not yosemite
-
Loading pictures on iPad?
I had 300 photo's scanned and planned on using them on an iPad for showing students. I mounted the drive of the iPad with my Linux OS, and put the pictures in the photo's directory. They will not display on the iPad even though they are definitely th