Last Questions on Multi Cores....

I'm sure it's been asked before so apologies in advance, first correct responses get a 'helpful' and 'solved'.
So a 2.66G quad core, does that mean it works just like 4 separate 2.66G processors? And similarly a 3.06G Core 2 Duo, is that like 2 separate 3.06G processors? And finally, what is the difference between a 'Core Duo' and a 'Core 2 Duo'??
Apologies again for these elementary questions which I'm sure you're all bored of answering by now. Thanks in advance.

It's not quite as simple as that but along those lines, if you have a Core 2 Duo 2.8GHz, although you have two 2.8Ghz processors, you can't just say that you have a 5.6 GHz machine.
Two or more Cores are only of benefit to software that support them, so if you use older software you'll often find that fewer higher speed Cores will actually give you better performance, I think multi-core is something that will come into life more in the future as software is written to take advantage of the extra cores, however at the moment, there is still little software that can use more than one or two cores.
As for the Core Duo/Core 2 Duo, the Core Duo was an earlier 32-bit chip with 2 cores (hence the core duo), they also did a Core solo edition. Core 2 is the later 64-bit Duo/Quad series of CPU's.

Similar Messages

  • Dual Processor Multi Core Parrell Processing Question

    Hey Guys
    I'm looking for a little clarification on an issue with parrell
    processing in LabView. If I have a Dual Processor machine with two 4 core CPU's
    will be able to access all 8 cores in the LabView environment. I'm presuming it
    can use any cores the operating system can see?   
    Thanks for the help,
    Tom
    Solved!
    Go to Solution.

    Norbert B wrote:
    it is the job of the OS that applications can use all cores if necessarry. So for the application itself, it should make no difference if the system (in hardware) is MultiCPU, MultiCore or even simply HyperThread.....
    Norbert 
    Its true, but I would like to add my 5 cents here.
    Lets say, if you have single loop like
    while (true){
    //do something
    then OS will get no chance to run it in multiple threads. So, you will get max 12,5% CPU load at 8 cores PC or 50% max on dual core PC.
    I have dual core PC right now, and lets check it:
    So, as we can see - 50% CPU load reached (one core loaded more, but its another story).
    Well, if we will use two while loops, then we will get 100 % load:
    Of course, if you will need to load all 8 cores, then you should have 8 parallel loops.
    Compare BD above with the following:
    We have two Array minmax functions, and they independend, but we have 50% only.
    Well, you can get also 100% CPU utulization withing single while loop. In th example below you have two SubVI, which called in the same loop:
    We have here 100 %. Important, that these VIs should be reenterant!
    See what happened if they not reeenterant:
    Now a little bit about Vision. Behing of most of the Vision SubVIs are DLL calls. Some Vision functions already optimized for multicore execution. For example, convolution:
    On the BD above we have single loop with one SubVI, but both cores are used (because convolute itself already optimized for multi core).
    Remember, that not all Vision functions optimized yet. For, example, LowPass still single-threaded (compare this BD with BD above):
    Sure, we can utilize multi cores - just perform parallel execution (you have to split image to two parts, then join together and so on):
    Remember, that SubVIs should be reeentrant, and all DLL calls should be thred safe (not in UI thread). Also good idea to turn off debugging in such experiments for eliminate additional CPU load.
    Another point about 8 cores. As far as I know, LabVIEW (and LabVIEW-based application) will support only 4 cores within one execution system by default (at least prior to LabVIEW 2009). If you need to utulize all 8 cores, then you should add some lines into LabVIEW.ini. Refer to the following thread where you can found more details:
    Interpolate 1d slow on 8 core machine
    Hope all written above was correct. 
    Thank for reading and best regards,
    Andrey.
    Message Edited by Andrey Dmitriev on 11-27-2009 02:50 PM

  • Aggregate Storage And Multi-Threading/Multi-Core Systems

    Please pardon if this question has been asked before, but the Forum search is not returning any relevant results.
    We are in the process of purchasing hardware for an 11.1.2 Essbase environment. We are going 64-bit, on Windows 2008, with either 32 GB or 64 GB of system RAM. The debate we are having is the number of CPUs and cores per CPU. We have not built any ASO databases as of yet, but we plan to launch a major BSO to ASO conversion project once 11.1.2 is off the ground here.
    Historically, with BSO, we did not see performance improvements significant enough to justify the cost of additional CPUs when we ran calcs on multi-CPU systems vs. single or dual CPU systems, even when the settings and design should have taken the most advantage of BSO's multi-threading capabilities. However, it would seem that ASO's design may be able to make better use of multi-core systems.
    I know that there are a lot of factors behind any system's performance, but in general, is ASO in 11.1.2 written well enough to make it worthwhile to consider, say, a four CPU, total 16 core system vs. a 2 CPU, total four core system?

    Grand central dispatch - infancy, not really doing its job, and I don't think apps have to be specifically written for HT, but they do have to not do things that they use to - prevent threads from going to sleep! or be parked.
    high usage is not necessarily high efficiency. often the opposite.
    Windows 7 seems to be optimized for multi-core thanks to a lot of reworking. Intel wants and knows it isn't possible to hand code, that the hardware has to be smarter, too. But the OS has a job, and right now I don't think it does it properly. Or handle memory.
    Gulftown's 12MB cache will help, and over all should be 20% more efficient doing its work.
    With dual processors, and it doesn't look like there are two quick path bridges, data shuffling has led to memory thrashing. Use to be page thrashing with not enough memory. Then core thrashing but having the cores, but not integrated (2008 is often touted as being greatest design so far, but it was FOUR dual-cores, 2009 was the first with a processor that really was new design and (native) 4-core.
    One core should be owned by the OS so it is always available for its own work and housekeeping.
    The iTunes audio bug last year showed how damaging and not to implement code and how a thread could usurp processing and add a high cpu temperature while basically doing nothing, sort of a denial of service attack on the processor - those 80*C temps people had.
    All those new technology features under development and not like OpenCL, GCD and even OpenGL are tested, mature but rather 1.0 foundation for the future. A year ahead of readiness.

  • SAP XI on a multi-core, multi-thread server?

    Hi Everyone!
    Can anyone tell me whether SAP XI can run on a Server whose processor is multi-core, multi thread (4 cores, 8 threads per core, 32 threads)?
    Thanks in advance!
    Warm regards,
    Glenn

    Hi Ravi,
    Thanks for your reply! The server in question is SUN Solaris. What sort of confguration needs to be done on both the OS side and on XI? Is there a SAP note I can follow?
    Warm regards,
    Glenn

  • Canon HG20 One Last Question

    Before I buy my Canon HG20, I have one last question.
    I have seen warnings various places on the net about having a powerful enough computer to work with the data produced by this camera.
    I have an iMac 24 2.16 2GHz Intel Core 2 Duo with 2 MHz Memory, NVIDIA GeForce 7300 card, running OS X 10.5.6 with FCE 4.0.1.
    Am I OK?
    Thanks,
    Jim

    That is a perfect machine for AVCHD editing. i use a puny Macbook and I have experienced no problems, everything is very fast. To work with AVCHD, you need an Intel processor and to have at least FCE4. 2GB of RAM is also a good idea to have (I assume that's what you meant you had when you said you had "2 MHz Memory"). From what you have said of your specs, I can't foresee any problems. If a Macbook can do it well, you can expect an iMac to do it amazingly.
    Enjoy your new camcorder, I definitely am pleased with my HG21 (basically the same thing, just more memory and a viewfinder).
    Message was edited by: skalicki`

  • What is a multi-core intel processor please?

    silly question i know but i was gonna download some trial software and this was in the system specs!
    my macbook is a 2ghz intel core 2 duo, is this classed as a muti-core please?
    again apologies for the silly question but i was just a little confused
    cheers!

    Hi Bad Monk,
    no need for apologies.
    Your Intel Core 2 Duo processor is a multi-core processor since it incorporates 2 cores.
    See here for some background informations: http://en.wikipedia.org/wiki/Multi_core
    Have Fun
    Stefan

  • Logic Pro on Multi-Core Processors?

    Hi, I've heard that multi core processors such as those in the new iMac and in the Mac Pro are only any good if the software knows how to use them properly. So, does Logic know how to use the multi cores of the iMac and Mac Pro properly?
    Ultimately I want to know if I would be better off with say a 3.06G core 2 duo, or a 2.66G i5?? For Logic only, I couldnt care about games or anything else.

    I can't address the theoretical on this thread; I can only say that I've had no problem setting my buffer at the lowest setting possible on my 8-core to record musicians live in my studio, and I have no problems. As I monitor my 8 cores, I can see none of the cores working particularly harder than others, and I've yet to hit the red with any of them. I don't monitor on my 2.4 GHz dual core laptop at the lowest buffer settings, because it does have problems with lower buffer settings.
    I disable some plug-ins that introduce latency by when I'm tracking live musicians; the pitch correction & the ad-limiter are the main examples for me; then I bring them in during mix.
    There might be something about how I record; but I have for the last couple of years changed to simply monitoring through Logic with software monitoring, and set the latency to 32 samples and never changed it. I work with professional studio musicians, and nobody's had a problem with the monitoring; and I haven't had any trouble tracking... never knew that I was supposed to. On some tracks with a lot of virtual instruments, I'll often go ahead and freeze tracks before tracking overdubs, but that's been more about hung notes or a sudden burst of musical debris as the buffer catches up and spits 2 measures worth of notes out at once.
    In the most recent project I did recording over 70 songs and 24-5 minute soundtracks, the final step in most of the recordings was recording 3 layers of 5 vocalists (each on their own mic & track) with EQ & compression plugins on every vocal channel strip. That was on top of typically 12 to 20 tracks of live & virtual instruments (some mono & stereo), while feeding control room mix & a dual mono cue mix.
    Again, I'm not disputing the theory here; I just know I can do this with my 8-core and it doesn't break a sweat; my dual core does. I didn't know I wasn't supposed to be able to do it; I just did it and it works.

  • What Do Multi-Core Processors Do?

    I posted a thread on this some time ago, and my understanding was that a multi-core processor allowed for computing tasks be performed simultaneously. Rather than one after another, which is what a single-core processor would do. This is often applied within the applications themselves, to increase execution speed. Such applications being multi-threaded applications.
    But I've recently learnt that even single core processors can execute code in more than one thread. So in this sense, what extra functionality does having multiple cores give you? Or am I wrong in thinking that single core processors can do this too? I'm trying to weigh up the advantages of buying a Mac Pro over a different model like an iMac.
    There's a hole in my understanding somewhere, I just don't know where it is.
    Any info appreciated.
    Many thanks,
    Adam

    multi-threading varies by application
    Think of the system having reserved rights to 0, some background task(s) to 1, Safari on 2, etc. is one scenerio.
    Some but not all or even a lot of apps are truly multi-thread.
    Faster processor cores are still more important than how many cores.
    one core with hyper-threading can execute two threads, and deliver 20-35% more in performance at the expense of running hotter and using more watts. HT came back in 2009 with Nehalem and Core i-Series.
    Dual processor, two cpus, have been around for a long time on Macs back to G4/500DP and dual and quad-core is just more efficient to manufacture and build into systems (dual core Atom or A8's in mobile devices).
    Programs that worked without HT sometimes don't work properly with H-T until they are recompiled and optimized properly.
    Your real question is what Mac to buy though, and what you actually plan to run and do.
    And there are processors for laptops, desktop, towers and more. And all have different performance.
    http://www.intel.com/products/desktop/processors/index.htm
    http://macperformanceguide.com/index_topics.html
    Some iMac vs Mac Pro
    http://www.barefeats.com/imac10o.html
    http://www.barefeats.com/imac10v.html
    So getting things to work in multi-core, multi-threaded, how much memory you want, the need for multiple drives (SSD boot drive and 1TB data drive even in iMac now), and graphic offerings.
    Start with what you use, then to what you need to buy. Don't put the cart before the horse. A Mac Pro or iMac may seem at first to be on somewhat equal footing.
    http://www.barefeats.com/wst10c2.html
    There is a huge range in performance on MacBook/Air/Pro platform.
    http://www.barefeats.com/mbpp31.html

  • Public static Thread currentThread() and multi core processors??

    Hello,
    I have the following basic question: what does public static Thread currentThread() mean in the context of multi core processors where several threads may execute concurrently?
    Any clue welcome,
    J.

    Hi balteo,
    When you invoke Thread.currentThread(), you get the reference of the current thread : the thread where you make the call.
    Just try :
    System.out.println("My program is running thread : " + Thread.currentThread().getName());
    mean in the context of multi core processors where several threads may execute concurrently?Several threads may run concurrently with single core processors. The number of concurrent threads you may execute depends of the processors architecture and the OS.

  • Multi-core processors (core2duo, core2quad, phenom)

    How does Linux (in general) handle multi-core processors? I've read that in the Windows world, programs must be written to use more than one core/processor.
    Do you need to recompile programs with architecture-specific makepkg.conf settings (march, mtune, j) to be able to use the extra cores?
    Finally, is there a good reason to get a tri or quad core processor over a dual core processor? Would a 3.0 ghz dual outperform a 2.4 ghz quad?
    Last edited by mrbug (2008-06-16 17:00:09)

    mrbug wrote:
    Regarding Linux being better with SMP than Windows, that's what I thought... and it's good news for me.
    I do a fair amount of multimedia encoding/decoding. I want to get back into 3D modelling/rendering (with Blender). I also like to listen to music while using the computer, and it's really annoying when the sound skips out for a second because Firefox is forking or Java is loading.
    Would you suggest that I go for a higher speed dual over the lower speed quad then? I think that the quad would be more "future-proof," but I don't know if I like the idea of the individual core speed being lower than my current (single) processor speed.
    Well, in the future applications will more effectively use more processors, so I'd go with the Quad-Core...
    Dual-core also seems fine (I've got dual core in both my desktop and laptop)
    The single core speeds of dual-core processors today are lower than the single processors speed before them, but they seem to be better, don't they ?
    Last edited by moljac024 (2008-06-16 18:32:02)

  • Question about Quad Core 2.93 and Octo-Core 2.66

    OK, so forgive me cause I am asking a question that has been asked a zillion times. I have read and searched and read and searched, however, I still don't quite understand a few things.
    I am a huge Aperture user. I shoot the Canon 1Ds Mark III and use photoshop a lot as well.
    I am still confused. What is the difference in performance between a
    loaded 8 GIGs ram Quad Core 2.93 or
    a middle 8-Core 2.66 12 gigs RAM
    I read benchmarks after benchmarks, but most use games for their stats and that does not help me. I read the boards, but it is all so confusing what people think. I went to the Apple store, and of course, they immediately said 8-core! hahaha.
    I hear an 8-core can be slower at single core apps than a quad core and so on and on.
    please help me!

    Hi-
    this question si about what the ** is the difference between a Quad 2.93 and a Octo 2.66.
    The question is pretty vague.
    Maybe asking "What benefit do I get from an octo core as opposed to a quad core?" would be better.
    To understand the main difference, and the main benefit of an octo core over a quad core, understanding the concept of multithreading is necessary.
    Basically, Multithreading is the ability of a system to break tasks up into portions (threads), and assign these portions across multiple CPU cores, enabling the calculation, thus the process, to be be completed faster than if the entire process were to be done on a single core.
    Because of this, more cores allows for faster completion of system functions. Yes, it's faster.
    Currently, some software isn't quite up to snuff in supporting/utilizing multithreading abilities of multi core systems.
    But, that is changing, and changing rapidly.
    Soon, all software will be able to utilize the multithreading ability of a multi core system, and greater increases in system performance will be realized.
    In the upcoming OS 10.6 release, further enhancement of multithreading operation will be seen.
    What this all means to the end user, say in Photoshop, is, work will fly, complex enhancements will be almost instantaneous, and productivity can be increased.
    Along with the multi core, multi channel memory will also allow for the use of larger amounts of RAM, with out the bottlenecking that occurs in singe channel systems.
    Again, everything works faster.
    The octo core allows for more physical RAM, which, even now, but more so in the near future, always helps with memory hungry applications like Photoshop.
    Basically, the biggest difference between the two machines, is the octo core is more future proof- that is, it will support future software enhancements better than the quad core.
    And, we are talking +near future+.
    I believe the Quad is limited to 8 gigs RAM, not 16.
    Both machines can use 4GB DIMMs, so the quad core can use 16GB and the octo core can use 32GB.
    Buying RAM from a trusted third party vendor can reduce costs greatly, without affecting the Apple warranty.
    Again, Apple employees are telling you what the book says, what they currently offer, not what can be done.
    Apple store said SDD in a Mac Pro is not a good idea at all. Again, more conflicting suggestions.
    The Apple store will not recommend anything that Apple is not officially selling.
    SSDs work, and they work well.
    Just ask Samsara, or some of the other hot rodders on these forums.
    And because I don't understand scratch disk, SDD disks, raptor drives etc, this all is not getting me anywhere. thus, why i tried the Apple store.
    Ask. Study. Use Wikipedia.
    Educating oneself is paramount to improving decisions, questions, work and life........
    SSD - The future, now. Fast, expensive (but coming down in price), no moving parts (reliable)Solid State Drive
    *Raptor Drives* - A family of 10,000 RPM SATA drives from Western Digital. These drives are high performance. They make systems run faster.
    *Scratch Disks* - These are additional hard drives (in addition to the system drive) that allow for greater utilization of virtual memory- the writing of files, temporarily, to hard drive, to free up physical memory and allow faster calculations of processes.
    Anyone who does work with video or photography software, must have a working knowledge of the benefits of a scratch drive.
    Photoshop runs +way faster+ with a fast scratch disk.
    When seeking advice on any forum, the more specific the question, the easier it will be for contributors to provide advice that is pleasing to your senses.
    I've given you my take on what I feel may be your questions intent.
    Hopefully, it wasn't a waste of time.....

  • Performanc​e comparison​---using LABVIEW..b​etween Embedded and general-pu​rpose Intel's single VS multi-core CPU

    hi guys;
    kindly, can any one tell me : is it possible to use Labview installed on desktop pc to show up statistically the main performance key features between mutlicore systems and single core systems but with (two versions, embedded and general purpose CPU) . in other words: I'm trying to resemble embedded cpu with general purpose CPU so that i can only work on Desktop pc than say that the obtained results are the same for embedded multicore CPU.
    to get things more clear:...embedded multicore processors are now hitting the embedded market segments such as (small and portable devices with internet, multimedia and wimax tech. enabled that take advantage of recent multicore tech.).
    general-puroses Multicore processors: like desktop and servers based processors,
    according to what 've read, Intel is producing same processor model but with different applications : (embedded and general-purposes applications)

    Hello,
    Please look at this page which shows a new feature in LabVIEW 2009, but particularly interesting is the video which shows the performance benefits on a PC platform of single core VS multicore.
    LabVIEW doesn't have any ability to emulate a multi-core embedded processor (unless its an intel x86 processor that labVIEW supports!) so to discover the performance benefits of embedded multicore processors, you would need an external hardware board and devise a test in which labVIEW can measure the timing via an external pin toggled by a program running on the embedded processor that could utilise multiple cores (there may be other ways but this is the way that comes to my mind).
    I hope this helps you!
    Mark B
    ===If this fixes your problem, mark as solution!===

  • Multi Core Mac Users: Dynamic Link, AE, and Warp Stabilization.

    Now that Final Cut X has lost it's edge .. and more Mac users may be migrating .. here is some input :
    Stabilization was the most important 'effect' which prompted me to buy a 12 Core Mac, CoreMelt's Lock & Load Stabilization AE Plug In, and the Adobe Master Suite. Second was the "Multi-Camera" editing.
    Additional purchases ( to solve a sluggish frame rate ) were a NVidia GTX 285 video card, more RAM, and a 4 TB RAID 0.
    Now with my Mac Pro running ( after several issues ) I would like to point out that:
    1.) The "Adobe Stabilization Server" seems to only use one of the cores. It also seems that it is faster without AE  multicore processing enabled. Other effects use half and it seems that some use all. With stabilization very time consuming .. I would hope that Adobe would address this like the multiprocessing 'aerendercore' processes that are seen in the Activity Monitor. I find that the Activity Monitor is one of the most important applications to be aware of ... and for developers who are interested in improving their applications .. a Godsend .. others who would like to bury their performance issues .. a nightmare. So .. a Multi Core Mac may be redundant if you
    2.) If you are having any dynamic link crashes or lost linked compositions ... read my other posts.
    3.) to be cont.

    Ashe?
    If yes, your problem is the result of bad karma.

  • PSE 10 both Organizer and Editor crash on multi-core hardware; set affinity to single cpu mode fixes

    As I have noted in thread http://forums.adobe.com/thread/941128 I have found that both the editor and the organizer for PSE 10 crash in a multi core environment, I am running WIndows 64 bit, latest updates (includes sp1), I had the same problems with Windows 7 32 bit.
    Solution is to set the affinity to a single cpu.  From the task manager, select the 'processes' tab, find the exe (eg PhotoshopElementsOrganizer), right-click, select 'Set affinity...' and reduce the number of CPUs selected (checked) to exactly one.  (Under different versions of Windows the exact means for doing this varies, but the essential steps are the same).  It doesn't matter which cpu you select, but if you do both the Editor and the Organizer, put them on different CPUs.
    Given that pretty well all hardware these days is multi-core, my assumption is that Adobe test in a virtualized environment and so do not discover this type of unreliabillity.  Adobe really do need to test their software more thoroughly as the exact same problem existed in PSE 6, so it is hardly new to them.

    The solution is in the above.
    Should Adobe read this, they should take note that a virtualized environment does not provide a decent fidelity emulation of multi-core CPU systems.  The ONLY way to test the reliability of an application is on REAL hardware.

  • Details for last question I post

    the original code for last question I post(about the DataInputStream& EOFException) is here, thanks if anyone will bother to read it
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.* ;
    public class MasterMindServer
         public MasterMindServer()
              try{
                   ServerSocket serverSocket=new ServerSocket(8000);
                   Socket socket=serverSocket.accept();
                   HandleAClient thread=new HandleAClient(socket);
                   thread.start();
                   }catch(IOException e){System.out.println("Error:"+e.toString());}
         public static void main(String args[])
              new MasterMindServer();
    //inner class
    class HandleAClient extends Thread
         DataOutputStream out;
         DataInputStream in;
         BufferedReader fromFile;
         private Socket socket;
         String line;
         public HandleAClient(Socket socket)
              this.socket=socket;
         public void run()
              int x,o;
              try{
                     out=new DataOutputStream(socket.getOutputStream());
                   in=new DataInputStream(socket.getInputStream());
                   fromFile=new BufferedReader(new FileReader("colorcode.txt"));
                  while((line=fromFile.readLine())!=null)
                    for(int i=0;i<10;i++)
                      String t=in.readUTF();
                      x=check_column(t);
                       System.out.println(x);
                       o=check_color(t);
                       System.out.println(o);
                       out.writeInt(x);
                       out.writeInt(o);
                       if(x==6) break;
                     out.writeUTF(line);
                   socket.close();
                   System.out.println("close");
             }catch(IOException e){
             System.out.println("Error:"+e.toString());}
         public int check_column(String s)
              String str;
              str=s;
              int count=0;
              for(int i=0;i<6;i++)
                   if(s.charAt(i)==line.charAt(i))
                   count++;
              return count;
         public int check_color(String s)
              String str;
              str=s;
              int count=0;
              for(int i=0;i<6;i++)
                   if((line.indexOf(s.charAt(i))!=-1)&&(line.charAt(i)!=s.charAt(i)))
                   count++;
              return count;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.* ;
    public class MasterMindClient extends JFrame implements MouseListener,ActionListener
      /** Default constructor */
      //keep track of the row (or trial) and column number
      int trial_num, col_now ;
      Socket socket;
      int count[]={5,5,5,5,5,5};
    JPanel A[]  = new JPanel[10];
      JPanel B1[] = new JPanel[10];
      JPanel B2[] = new JPanel[10] ;
      JPanel notice = new JPanel() ;
      JPanel sub_notice = new JPanel();
      JPanel D1, D2 ;
      static JTextField [][]color = new JTextField[10][6] ;
      static JTextField [][]Output = new JTextField[10][2];
      static JTextField [][]Answer = new JTextField[1][6] ;
      static JButton []ok = new JButton[10];  
      JLabel L1 = new JLabel("Click the textfield to change color");
      JLabel L2 , L3, L4 ;
      String colorRange="BCGRYW";
      Color colorName[]={Color.black,Color.cyan,Color.green,Color.red,Color.yellow,Color.white};
      String temp ;
    public MasterMindClient() {
        // initialize
        trial_num = 0;
        col_now = 0;
        //sub_notice is Panel where the heading labels are placed
        sub_notice.setLayout(new GridLayout(1,3)) ;
        L2 = new JLabel("  ") ;
        L3 = new JLabel("X");
        L3.setHorizontalAlignment(JTextField.CENTER);
        L4 = new JLabel("O");
        L4.setHorizontalAlignment(JTextField.CENTER);
        L3.setToolTipText("matching color and column");
        L4.setToolTipText("matching color but not matching column" );
        sub_notice.add(L2);
        sub_notice.add(L3);
        sub_notice.add(L4);
        notice.setLayout(new GridLayout(1,2)) ;
        notice.add(L1) ;
        notice.add(sub_notice) ;
        // Get the content pane of the frame
        Container c = getContentPane();
        // Set GridLayout, 4 rows, 3 columns, and gaps 5 between
        // components horizontally and vertically
        c.setLayout(new GridLayout(12, 1, 5, 5));
        c.add(notice);
         JPanel Display = new JPanel() ;
         Display.setLayout(new GridLayout(1,2,5,5)) ;
       //create a Panel for each row to accept use input
       // color[][] textfield is where the user input
       // Output[][] is where to display the number of X and O
        for (int i = 0; i <= A.length-1 ; i++)
        A[i] = new JPanel() ;
        A.setLayout(new GridLayout(1, 2,10,10));
    B1[i] = new JPanel();
    B1[i].setLayout(new GridLayout(1,6,5,5)) ;
    B2[i] = new JPanel();
    B2[i].setLayout(new GridLayout(1,3,5,5)) ;
    for (int j = 0; j <= color[i].length-1 ; j++)
    color[i][j] = new JTextField() ;
    color[i][j].setHorizontalAlignment(JTextField.CENTER);
    if (i == 0)
    {color[i][j].setEditable(true) ;
    else
    {color[i][j].setEditable(false);
    color[i][j].addMouseListener(this);
    B1[i].add(color[i][j]) ;
    } // j loop
    ok[i] = new JButton("SEND");
    if(i==0)
         ok[i].setEnabled(true);
    else
         ok[i].setEnabled(false);
    ok[i].addActionListener(this);
    B2[i].add(ok[i]) ;
    Output[i][0] = new JTextField();
    Output[i][1] = new JTextField();
    Output[i][0].setEditable(false);
    Output[i][1].setEditable(false);
    Output[i][0].setHorizontalAlignment(JTextField.CENTER);
    Output[i][1].setHorizontalAlignment(JTextField.CENTER);
    B2[i].add(Output[i][0]);
    B2[i].add(Output[i][1]);
    A[i].add(B1[i]);
    A[i].add(B2[i]) ;
    c.add(A[i]) ;
    } //for i loop
    //D panel is where we store the answer[][]
    D1 = new JPanel();
    D1.setLayout(new GridLayout(1,6)) ;
    D2 = new JPanel();
    D2.setLayout(new GridLayout(1,2)) ;
    for (int j = 0; j <= Answer[0].length-1 ; j++)
    Answer[0][j] = new JTextField(0) ;
    Answer[0][j].setHorizontalAlignment(JTextField.CENTER);
    Answer[0][j].setEditable(false) ;
    D1.add(Answer[0][j]) ;
    Display.add(D1) ;
    Display.add(D2) ;
    c.add(Display) ;
    public void runClient()
         try
    {      socket=new Socket("localhost",8000);
    DataInputStream in=new DataInputStream(socket.getInputStream());
    int x=0;
    int o=0;
    try{
    while(true)
         while(trial_num<10)
              x=in.readInt();
              //System.out.println(x);
              Output[trial_num][0].setText(String.valueOf(x));
              o=in.readInt();
              //System.out.println(o);
              Output[trial_num][1].setText(String.valueOf(o));
              for(int i=0;i<6;i++)
              color[trial_num][i].setEnabled(false);
         ok[trial_num].setEnabled(false);
         trial_num++;
         col_now=0;
         if(x==6)
                   JOptionPane.showMessageDialog( null, "Congratulation, you've won the game !! " );
                   //ok[trial_num].setEnabled(false);
    break;
         if(trial_num<10)
         {  for(int i=0;i<6;i++)
              color[trial_num][i].setEditable(true);
              count[i]=5;
         ok[trial_num].setEnabled(true);
         if(x!=6)
         {  JOptionPane.showMessageDialog( null, "sorry you did not win the game");
         temp=in.readUTF();
         System.out.println(temp);
         //temp=in.readUTF();
         //System.out.println("can");
         for(int i=0;i<6;i++)
         System.out.println(i);
         char a=temp.charAt(i);
         int index=colorRange.indexOf(String.valueOf(a));
         Answer[0][i].setBackground(colorName[index]);
         trial_num=0;
         for(int j=0;j<10;j++)
         for(int k=0;k<6;k++)
         color[j][k].setBackground(Color.white);
         for(int j=0;j<10;j++)
         for(int k=0;k<2;k++)
         Output[j][k].setText(null);
         for(int i=0;i<6;i++)
              color[trial_num][i].setEditable(true);
              count[i]=5;
         ok[0].setEnabled(true);
         catch(EOFException em){}
         }catch(IOException ex){
              System.out.println("Error:"+ex.toString());}
    public void mouseClicked(MouseEvent e)
    for(int i=0;i<6;i++)
         if(e.getComponent()==color[trial_num][i])
         {         col_now=i;
         break;
    count[col_now]=(count[col_now]+1)%6;
    color[trial_num][col_now].setBackground(colorName[count[col_now]]);
    public void mouseEntered(MouseEvent e)
    public void mouseExited(MouseEvent e)
    public void mouseReleased(MouseEvent e)
    public void mousePressed(MouseEvent e)
    public void actionPerformed(ActionEvent e)
         try{
              send();
         }catch(IOException et){System.out.println("Error:"+et);}
    public void send()throws IOException
         DataOutputStream out=new DataOutputStream(socket.getOutputStream());
         char cbuf[]=new char[6];
         for(int i=0;i<6;i++)
              cbuf[i]=colorRange.charAt(count[i]);
    System.out.println(cbuf);
         out.writeUTF(new String(cbuf));
    /** Main method */
    public static void main(String[] args) {
    MasterMindClient frame = new MasterMindClient();
    frame.setTitle("Master Mind");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setLocation(300,300) ;
    frame.setSize(450, 450);
    frame.setVisible(true);
    frame.runClient();
    } // end of class

    I notice that you have several hundred lines of GUI code there. None of them have anything to do with the problem you are trying to solve. So put them all aside and write a SMALL test program that does nothing but the little loop you are having a problem with. Shouldn't be more than 20 lines of code.

Maybe you are looking for

  • Need help with making the webpage open in same window

    Hi. I want to make the menu page load in the same window. Right now, if you click on the index page, it will open the menu page in a new window. I know I need to use _self, or _parent. But I couldn't figure out where to insert it. Please help. Thanks

  • Rollovers work in iweb - but not online

    I have created a website in iweb with several hyperlinks just by highlighting a line of text and making it a link. The normal,rollover and visited colors work fine in iweb. However, once I go online to see my page the rollover color does not show whe

  • My screen has turned green how do I turn it back to normal

    my screen has turned green how do I turn it back to normal

  • Sub con po

    dear all, generally we create sub con po and send child materials against po with movement type 541 & tcode mb1b, previously it was working fine. but now some of pos are not properly executing. i have check stock for child materials, it is availalble

  • TimeMachine leaving out virtual systems

    During backup I wondered that it was so fast. Cant be since I have worked with and therefore edited several 10GB plus virtual systems. So i checked the files at the TimeMachine Drive vs. the iMac-Disk, user/Tom/virtualBox VMs. It seems the TimeMachin