Can a thread do more than one thing at once?

Hey all,
I'm confused a little bit on how a thread might act in this situation:
I have a server-client setup. The thread on the Client sits and waits to receive instructions from the server. When it does, it manipulates some ArrayLists I have in the Client in different ways depending on what the instructions from the server were. What would happen if I sent two instructions from the server, one right after the other, and they both had to manipulate the same ArrayList. I was going to synchronize the methods operating on the arraylists, but I didn't know if that would work since it's really just one thread. But then, since it's just one thread, can it do more than one thing at a time? Or will it queue them up somehow? Thanks!
Matt

Rhesus21 wrote:
Hey all,
I'm confused a little bit on how a thread might act in this situation:
I have a server-client setup. The thread on the Client sits and waits to receive instructions from the server. In client-server applications, the clients make requests and the server performs them and sends back a response.
It appears you have a central "server" which sends back updates/instructions to the client in a server-push approach.
When it does, it manipulates some ArrayLists I have in the Client in different ways depending on what the instructions from the server were. What would happen if I sent two instructions from the server, one right after the other, and they both had to manipulate the same ArrayList. Are both instructions sent on the same connection? Does your client only read the next instruction after performing the previous one. Are you using multiple connections and do you create a thread for each connection?
I was going to synchronize the methods operating on the arraylists, but I didn't know if that would work since it's really just one thread. If you have only one thread you don't need to use synchronized.
But then, since it's just one thread, can it do more than one thing at a time? No.
Or will it queue them up somehow? Yes. Each connection has a buffer at both ends. When the buffers fill the sender blocks waiting for the receiver to read the data.

Similar Messages

  • Can I acquire from more than one device at once using Labview?

    I have two SC-2345 boxes. One is device 3 and one is device 4. Can I acquire from both of these boxes at once? I know for most of the AI functions you just put in one Device number. But what if I want to acquire from 32 channels at once? How would I do this? Your help and tips are appreciated.
    ALSO- If you know about SC-2345 boxes, how many Analog input channels can I use? I see 8 slots for AI and the other 8 appear to be for signal conditioning. Can I still use these for AI? Could I have 16 thermocouple modules in one box?
    THANKS!
    Lauren

    Lauren,
    Yes, you can simultaneously acquire from both devices. However, each device will require its own analog input task. Furthermore, if you want to synchronize the acquisitions, you will need to connect the DAQ devices that are cabled to the SC-2345s with a RTSI cable. Below, I have included a link to a KnowledgeBase detailing RTSI:
    KnowledgeBase: What is RTSI?
    In order to understand the required programming structure, you may want to examine the following examples that are available in LabVIEW (one uses NI-DAQmx and the other uses Traditional NI-DAQ):
    NI-DAQmx
    Multi-Device Synch-Shared Timebase-Cont Acquisition.vi
    Tradi
    tional NI-DAQ
    Two E-Series Shared ScanClk.vi
    With regards to your second question, the SC-2345 provides access to 16 analog input channels through 8 modules. Most analog input modules have two channels. However, both of the SCC-TC series thermocouple input modules only have one channel because the other is used for the built-in CJC sensor. Thus, using the SCC-TC series modules, you will only be able to acquire from eight thermocouples with a single SC-2345.
    Good luck with your application.
    Spencer S.

  • Why can't i buy more than one thing at a time?

    I have 20+ items in my Wish List & I can find no way to buy all of them at once...only one at a time.  Since that is a highly irritating way to make my purchases, I have to believe that I am missing something somewhere - is there no shopping cart anywhere?
    Thank you.

    For some reason the 'buy all' button that used to appear on the wish list screen has been removed from the current version of iTunes, so you will need to buy items individually by clicking on their prices. You can try leaving feedback for Apple and mayeb the 'buy all' button will be reinstated in a future update : http://www.apple.com/feedback/itunesapp.html

  • ITunes 8.1 Can't Seem to do More Than One Thing at a Time

    I upgraded to 8.1 and now, rather than a "faster" iTunes experience as was advertised on Apple's website, iTunes can't seem to do more than one thing at a time without locking up the application completely. For instance, when trying to download podcasts if I choose to hit more than one "Get" button at a time iTunes will freeze up until the first podcast has completely downloaded. During this time I cannot access any other screen in iTunes at all.
    This freezing of iTunes also occurred while I was trying to sync my iPhone 3G. I received the Calendar sync error that a few other people have mentioned on the forum and wanted to turn off Calendar sync (since I don't use it and don't understand why iTunes turned it on by default, apparently, after the upgrade) but I had to wait for my iPhone 3G to completely sync before I could gain access to any of the tabs in the iPhone sync window.
    So, basically it seems like the new version of iTunes (8.1) really doesn't like to be bothered while it is trying to copy data from one place to another.
    Any ideas?

    I'm using Vista Ultimate 64-bit and iTunes 8.1 installed OK, but required a restart of the entire OS after upgrading. It takes forever to launch, clicking on certain items (like applications) causes itunes to freeze for about 15-30 seconds before it continues (this is actually something that's been there since the introduction of the app store), I've had to switch my library view to LIST and avoid any sort of album art. Using album art to view my library causes iTunes to be extremely, obnoxiously unresponsive.
    The best part - plugging in my iPhone to sync it... iTunes simply sits there dumbly - doesn't even recognize that I've plugged my iPhone in. So now I can't even sync. QUALITY product, quality. So the app I'm FORCED to use to manage my phone doesn't even work after upgrading. Outstanding.
    I'm terrified of uninstalling and reinstalling... the last time I did that with iTunes it jacked my library up... it "lost" all of my music... basically it disassociated all of the music (even the stuff purchased through the itunes store) with the index file so I had to re-import EVERY song and delete the duplicate entry.
    I searched a ton of forums looking for any clues as to how I could improve performance... All I run into is apple fan boys flaming any and all forums to the point of PC *****, no Apple *****, and so forth. Extremely unhelpful.
    The fact is this - if I wasn't forced to use iTunes to manage my non-jailbroken iPhone 3G, then I'd dump it completely. It is a horrible app. Why punish the customers that haven't gone the route of "jail breaking" their iPhones?
    One individual on one of the forums suggested that blue screens, and all the other random errors, including slow performance were due to a lack of RAM. I have 4GB of RAM on my machine I can run a virtual Fedora core 9 machine and a virtual WinXP machine on my Vista x64 box and still not have any performance issues with those two virtuals in the background sucking up system resources, yet with nothing open and less than 50% of my 4GB of RAM in use iTunes performance is abysmal. I have not run into any other application on my Vista machine that performs as badly as iTunes.
    And Apple is touting a "64-bit" version of iTunes - it isn't. The applications the 64-bit installer installs are all 32-bit.
    So, I'm searching as the two of you are for an answer to horrible performance of iTunes.
    Even exiting out of iTunes takes a day and a half... "saving itunes library".... And my "library" isn't that big.

  • Execute more than one thing at the same time.

    Hey why every time i want to execute more than one thing(create tables) at the same time
    it say "ORA-00911: invalid character" , i dont wanna execute one thing at a time. check the pic please
    http://img370.imageshack.us/img370/5120/oraclesw5.jpg
    but in my school i use something called isqlplus and i can execute all the things i want at the same time with-out any error.
    im using right-know
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    1) Unless you are using something like DBMS_JOB, SQL*Plus, iSQL*Plus, the Oracle XE web-based front-end, or any other application is going to execute one SQL statement at a time.
    2) There is a dedicated XE forum-- the folks over there might know how to run a script using this particular front-end.
    3) Assuming the XE database is on your local system, you should be able to log in via SQL*Plus and use that utility to run your scripts.
    Justin

  • I have a PC, Windows 7 x64. I installed a plug-in in Elements 13. I tried to installed another plug-in. It replaced the first plug-in . Can't I have more than one plug-in at a time??? If so, how?

    I have a PC with Windows 7 x64. I have Elements 13. I installed a plug-in (Topaz) which appeared under the Filter Menu.
    Then I tried to install my new Canon Printer software plug-in which put it under FILE > AUTOMATION TOOLS. However, when I tried to use TOPAZ under the FILTER MENU it was gone. In other words, the Canon printer plug-in replaced my Topaz plug-in. When I reinstalled the Topaz plug-in, it replaced the Canon Printer Plug-in.
    QUESTION: Can't I have more than one plug-in installed in Photoshop Elements 13 at a time? So that the Canon printer plug-in is in AUTOMATION TOOLS, and the Topaz plug-in is under the FILTER menu?

    Have a look at this thread.
    http://discussions.apple.com/message.jspa?messageID=2369954#2369954
    Before you try some of the suggestions bear in mind that your iPod is still under warranty.

  • HT3924 Can I set up more than one monitor/displays to my Macbook Pro?

    Can I set up more than one monitor/displays to my Macbook Pro?

    OSX Maveric 10.9.1.  I have a 2.9 GHz Intel Core i7 with 8GB memory.  I like the new things I can do with maveric.  I have conected only one external monitor through the thinderbol conecting cable to VGA or HDMI.  I would like to conect 2 monitors and still use the laptop display ( total of three monitors). Can I do that?

  • Can not color label more than one file at a time

    Hi,
    I've had this problem since 10.6.6-ish, i can not color label more than one file at a time in the Finder.
    Wether i select two, twenty or twohundred only one file gets color labeled.
    It doesn't seem to matter if i assign a color label through the File menu or right click > label.
    Figured a re-install might fix this but it hasn't (even a clean install without restoring any kind of backup).
    Does anyone else have this issue and/or a fix for it?
    Thanks,
    Jay

    Aaaaanyone ?

  • How do I highlight more than one thing at a time on a Mac please

    how do I highlight more than one thing at a time on a Mac please

    Do you mean items in Finder?
    To highlight (select) a whole block of items :
    - click the top item you want
    - hold down Shift
    - click the bottom item you want
    The whole range from top to bottom will be highlighted
    To select random items :
    - click the first item
    - hold down the Command key
    - click any more items anywhere in the list
    Just the items you clicked will be highlighted
    This technique works also in apps like iTunes, iPhoto, etc.

  • My sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same computer so my stuff with save?

    my sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same macbook so my stuff with save?

    How to use multiple iPhone, iPad, or iPod devices with one computer. The only way is for you to have a separate user account to log into on that computer.

  • Can I back up more than one mac to the time machine:

    Can I back up more than one Mac to a time machine? I have a laptop and a Mac Desktop computer can I back up both on the same Time machine

    Absolutely.
    However, quoting from ASC contributor Pondini's excellent Time Machine FAQ:
    It is advisable, though, to partition an external disk that will be connected to your Macs into one volume for each Mac ...

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • Why can´t i have more than one initiator task on my bpm process

    Hi All.
    I am working with BPM 11g and would like to know:
    Why can´t i have more than one initiator task on my bpm process
    In this case, i will have two separeted process where each has its initiator task?
    Regards,
    Diovani

    Hi Diovani
    Two different processes can have different task initiators...task initiator means creation of a process instance which can happen only once

  • Syncing Issues when trying too sync more than one thing

    since the 8.0.2 update syncing has been real glitchy for me lately when i try too sync my iphone and ipod. for whatever reason, i cant sync more than one thing at the same time. for example if i have my iphone still plugged in, then plug in my ipod too update it, soon after the itunes would give me a unknown error then lock up. specifically this error. http://img407.imageshack.us/my.php?image=unknownituneserrorjq3.jpg
    sometimes it would say iphone, sometimes it would say ipod.. that error would just depend on which was plugged in first.
    its just weird, windows detects both drives fine. and if i have them in one at a time itunes will be able to read and sync that device. unless this is a direct problem with my computer which i dont think, i dunno. both devices work in any usb port. it just doesnt like them both being in at the same time.
    this happening with anyone else?

    See this support doc, iPod for Windows: Only works with one iPod at a time. The title pretty much says it all. If it's worked for you before then it's more likely by luck than design.
    tt2

  • How do I send pictures from iphoto to a group via email instead of to just one individual? I can't type in more than one name or send the pictures to a group.

    How do I send pictures from iphoto to a group via email instead of to just one individual? I can't type in more than one name or send the pictures to a group.

    I had a similar problem in that my wife's iphone 5 could not send pics with imessage.  Had to set the settings to default to SMS or whatever.  After laboring many hours on the web I coincidentally was on the phone with the internet people to question my internet speed.  They changed the router channel, which is something that I am capable of doing myself.  After that, the pics go over imessage.  My own Iphone didn't have the problem.  We are both latest IOS 7.0.6.

Maybe you are looking for

  • ICal Update failure to sync

    I responded to the invitation to update to the latest version of iCal but part way through the update my screen background was changed to a version from 2009 and the sync ran for over two hours but failed to produce any data in my mobileme version of

  • Acrobat 9.5 Pro loses italics when printing

    So, a little less than a month ago I spent a couple of weeks tracking down a patch to print italics correctly out of Adobe Pro 9.4.6 (http://kb2.adobe.com/cps/922/cpsid_92216.html).  Well we're all on 9.5.0 now and it is doing it again.  Could someon

  • TS4279 Why are photos rotated in iPhoto distorted in Aperture 3.4?

    Recently acquired Aperture 3.4 and merged existing photo library created in iPhoto. Now, all the photos that I had roated to vertical in iPhoto are distorted, with the image compressed horizonatally into the left half and the right half being **** ba

  • Image on monitor window does not match red playhead as it moves

    While editing a movie, imported slides do not match the monitor view. As the red playhead moves along to the right, when a slide changes the image on the monitor remains on the previous slide. After about 15 secs the next slide appears, but briefly t

  • After reinstalling Windows 8.1 64bit Pro Firefox will not show a video in HTML5, only in Flash Player.

    This worked before i reinstalled my operating system. I am on the same website it worked on and now the videos will only play in Flash Player... I have asked the website developer if he has changed something with the player, but nothing has been chan