Search Results

Search found 5817 results on 233 pages for 'multi threading'.

Page 28/233 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • ubuntu 11.10 on MacBookPro 7,1 can only see one cpu

    - by gozzilli
    On a MacBookPro 7,1 running ubuntu 11.10, System monitor only sees 1 core (instead of 2). cat /proc/cpuinfo | grep 'cpu cores' also gives: cpu cores : 1 I followed this guide and added acpi_apic_instance=2 to the line with GRUB_CMDLINE_LINUX_DEFAULT, but that doesn't seem to change the situation. What can I do? I'm using rEFIt, installed under MacOS, and running in dual boot with MacOS. After the rEFIT menu, I'm still presented with the GRUB menu (I'm assuming that's normal). I saw similar posts on this matter, but could not fix my problem with what they suggested. Any help appreciated. Thanks!

    Read the article

  • Restoring two finger middle click again

    - by Thomas A.
    it used to be that tapping two fingers on the touchpad send a middle mouse click. Now it does a right click and three fingers now are the middle click. I really can't understand the change and think it is a bug or badly copied from Apple or something. The reasoning escapes me totally. I use middle click to open links in a new tab in the browser all day and I rarely use right click (and I have a right mouse button below the touchpad, doh) Tapping three fingers on my tiny EeePC touchpad is next to impossible so I want the old behavior. I found: synclient TapButtons2=2 synclient TapButtons3=3 but that did not work on 10.10 Does anyone know how to restore sane behavior?

    Read the article

  • I seem to be missing a few important concepts with PhoneGap

    - by garethdn
    I'm planning on developing an app on multiple platforms and I'm thinking that PhoneGap might be perfect for me. I had been reading that it's one codebase for all platforms but looking at the PhoneGap guide it seems there are separate instructions for each platform. So if i want to develop for iOS, Android, BB and WP7 I need to write 4 different sets of code? I'm sure i'm missing something fundamental here. Aside from that, how do people usually approach a PhoneGap build? You obviously / probably want the finished app to look like a native app - is it more common than not to use jQuery Mobile together with PhoneGap? Is there a preferred IDE? I see, in the guide, for iOS they seem to suggest Xcode. I'm fine using Xcode but it seems a bit overkill for HTML & CSS. Do I need to develop in Xcode and if not how do i approach it? Use a different IDE / Text Editor and then copy paste into Xcode for building and testing? I know this question is long-winded and fundamental but it something which i don't think is properly addressed in the guides. Thanks.

    Read the article

  • Sempron 145 core unlocking

    - by Grant
    Call me a cheapskate looking for performance, but I have a Sempron 145 processor that has been unlocked to an Athlon II X2 4450e with a GIGABYTE GA-990FXA-UD3 motherboard, but only one of the two processor cores can be used at a time. If both of the cores are enabled in the BIOS the kernel will hang during boot, If I reboot the system and disable the second core (but not re-lock the processor), it will take me to the grub and then start normally. Is there a way to enable both cores and boot without kernel hangs?

    Read the article

  • Middle-click does nothing but makes window controls appear

    - by hleinone
    Just did a fresh install of Precise Pangolin on my laptop and noticed that the middle-click (actually three finger-tap on the touchpad) on Firefox doesn't work as it used to. When doing it on a link it doesn't get opened on a new tab, in fact, it doesn't get opened at all. Only the (useless) window size and position controls appear, as demonstrated on terminal in the following screen shot. How do I get my tab-opening middle-clicks back?

    Read the article

  • Develop for Desktop and Mobile at once

    - by Hola Soy Edu Feliz Navidad
    I need to develop a programm that is going to read some information from a special USB device and access information via Web Socket (socket.io preferred). My client wants to deploy this app on Mac OS X, Windows, Android and iOS. I was looking for development softwares valid for both: Desktop and Mobile, but it is still not clear for me and that´s what I found. Unity - Looks very good but to create a native plugin for reading from the device it lloks like I need the PRO edition. Adobe Air - Looks good but I´m not sure if I can write Native Plugins for all wanted platforms. LiveCode - Still inmature (lots of bugs) and I don´t know if it is possible to write native plugins for my device. Is there any other good platform for my case? What´s your option?

    Read the article

  • How do I make 3finger multitouch work on Samsung 530?

    - by RiaD
    I have Samsung 530U4C. How can I configure 3-finger gestures to work? Choosing next photo using 3 finger "scrool" worked in Windows 7. If I use synclient TapButton3=2 I may use it as medium mouse button, but there's problem: it gets cancelled after reboot, and as I read over the Internet, sometime else. Moreover, it would be great to see all gestures my laptop support and configure them all as I need. I find some info about touchegg, but I didn't manage to understand what it exactly is and even run it. Two-finger gestures works fine(configured using System setting menu)

    Read the article

  • Multithreading recommendation based on program description

    - by user260197
    I would like to describe some specifics of my program and get feedback on what the best multithreading model to use would be most applicable. I've spent a lot of time now reading on ThreadPool, Threads, Producer/Consumer, etc. and have yet to come to solid conclusions. I have a list of files (all the same format) but with different contents. I have to perform work on each file. The work consists of reading the file, some processing that takes about 1-2 minutes of straight number crunching, and then writing large output files at the end. I would like the UI interface to still be responsive after I initiate the work on the specified files. Some questions: What model/mechanisms should I use? Producer/Consumer, WorkPool, etc. Should I use a BackgroundWorker in the UI for responsiveness or can I launch the threading from within the Form as long as I leave the UI thread alone to continue responding to user input? How could I take results or status of each individual work on each file and report it to the UI in a thread safe way to give user feedback as the work progresses (there can be close to 1000 files to process) Update: Great feedback so far, very helpful. I'm adding some more details that are asked below: Output is to multiple independent files. One set of output files per "work item" that then themselves gets read and processed by another process before the "work item" is complete The work items/threads do not share any resources. The work items are processed in part using a unmanaged static library that makes use of boost libraries.

    Read the article

  • C# Communication between threads.

    - by GT
    Hi, I am using .NET 3.5 and am trying to wrap my head around a problem (not being a supreme threading expert bear with me). I have a windows service which has a very intensive process that is always running, I have put this process onto a separate thread so that the main thread of my service can handle operational tasks - i.e., service audit cycles, handling configuration changes, etc, etc. I'm starting the thread via the typical ThreadStart to a method which kicks the process off - call it workerthread. On this workerthread I am sending data to another server, as is expected the server reboots every now and again and connection is lost and I need to re-establish the connection (I am notified by the lost of connection via an event). From here I do my reconnect logic and I am back in and running, however what I easily started to notice to happen was that I was creating this worker thread over and over again each time (not what I want). Now I could kill the workerthread when I lose the connection and start a new one but this seems like a waste of resources. What I really want to do, is marshal the call (i.e., my thread start method) back to the thread that is still in memory although not doing anything. Please post any examples or docs you have that would be of use. Thanks.

    Read the article

  • In a multithreaded app, would a multi-core or multiprocessor arrangement be better?

    - by Michael
    I've read a lot on this topic already both here (e.g., stackoverflow.com/questions/1713554/threads-processes-vs-multithreading-multi-core-multiprocessor-how-they-are or http://stackoverflow.com/questions/680684/multi-cpu-multi-core-and-hyper-thread) and elsewhere (e.g., ixbtlabs.com/articles2/cpu/rmmt-l2-cache.html or software.intel.com/en-us/articles/multi-core-introduction/), but I still am not sure about a couple things that seem very straightforward. So I thought I'd just ask. (1) Is a multi-core processor in which each core has dedicated cache effectively the same as a multiprocessor system (balanced of course for processor speed, cache size, and so on)? (2) Let's say I have some images to analyze (i.e., computer vision), and I have these images loaded into RAM. My app spawns a thread for each image that needs to be analyzed. Will this app on a shared cache multi-core processor run slower than on a dedicated cache multi-core processor, and would the latter run at the same speed as on an equivalent single-core multiprocessor machine? Thank you for the help!

    Read the article

  • Java invokeAndWait of C# Action Delegate

    - by ikurtz
    the issue i mentioned in this post is actually happening because of cross threading GUI issues (i hope). could you help me with Java version of action delegate please? in C# it is done as this inline: this.Invoke(new Action(delegate() {...})); how is this achived in Java? thank you. public class processChatMessage implements Observer { public void update(Observable o, Object obj) { System.out.println("class class class" + obj.getClass()); if (obj instanceof String){ String msg = (String)obj; formatChatHeader(chatHeader.Away, msg); jlStatusBar.setText("Message Received"); // Show chat form setVisibility(); } } } processChatMessage is invoked by a separate thread triggered by receiving new data from a remote node. and i think the error is being produced as it trying to update GUI controls. do you think this is the reason? i ask because im new to Java and C#, but this is what is going on i think. SOLUTION: public class processChatMessage implements Observer { public void update(Observable o, Object obj) { if (obj instanceof String){ final String msg = (String)obj; try { SwingUtilities.invokeAndWait(new Runnable( ) { public void run( ) { formatChatHeader(chatHeader.Away, msg); jlStatusBar.setText("Message Received"); setVisibility(); } }); } catch (InterruptedException e){ } catch (InvocationTargetException e){ } } } }

    Read the article

  • Application doesn't exit with 0 threads

    - by Bryce Wagner
    We have a WinForms desktop application, which is heavily multithreaded. 3 threads run with Application.Run and a bunch of other background worker threads. Getting all the threads to shut down properly was kind of tricky, but I thought I finally got it right. But when we actually deployed the application, users started experiencing the application not exiting. There's a System.Threading.Mutex to prevent them from running the app multiple times, so they have to go into task manager and kill the old one before they can run it again. Every thread gets a Thread.Join before the main thread exits, and I added logging to each thread I spawn. According to the log, every single thread that starts also exits, and the main thread also exits. Even stranger, running SysInternals ProcessExplorer show all the threads disappear when the application exits. As in, there are 0 threads (managed or unmanaged), but the process is still running. I can't reproduce this on any developers computers or our test environment, and so far I've only seen it happen on Windows XP (not Vista or Windows 7 or any Windows Server). How can a process keep running with 0 threads?

    Read the article

  • C# Thread-safe Extension Method

    - by Wonko the Sane
    Hello All, I may be waaaay off, or else really close. Either way, I'm currently SOL. :) I want to be able to use an extension method to set properties on a class, but that class may (or may not) be updated on a non-UI thread, and derives from a class the enforces updates to be on the UI thread (which implements INotifyPropertyChanged, etc). I have a class defined something like this: public class ClassToUpdate : UIObservableItem { private readonly Dispatcher mDispatcher = Dispatcher.CurrentDispatcher; private Boolean mPropertyToUpdate = false; public ClassToUpdate() : base() { } public Dispatcher Dispatcher { get { return mDispatcher; } } public Boolean PropertyToUpdate { get { return mPropertyToUpdate; } set { SetValue("PropertyToUpdate", ref mPropertyToUpdate, value; } } } I have an extension method class defined something like this: static class ExtensionMethods { public static IEnumerable<T> SetMyProperty<T>(this IEnumerable<T> sourceList, Boolean newValue) { ClassToUpdate firstClass = sourceList.FirstOrDefault() as ClassToUpdate; if (firstClass.Dispatcher.Thread.ManagedThreadId != System.Threading.Thread.CurrentThread.ManagedThreadId) { // WHAT GOES HERE? } else { foreach (var classToUpdate in sourceList) { (classToUpdate as ClassToUpdate ).PropertyToUpdate = newValue; yield return classToUpdate; } } } } Obviously, I'm looking for the "WHAT GOES HERE" in the extension method. Thanks, wTs

    Read the article

  • Thread Message Loop Hangs in Delphi

    - by erikjw
    Hello all. I have a simple Delphi program that I'm working on, in which I am attempting to use threading to separate the functionality of the program from its GUI, and to keep the GUI responsive during more lengthy tasks, etc. Basically, I have a 'controller' TThread, and a 'view' TForm. The view knows the controller's handle, which it uses to send the controller messages via PostThreadMessage. I have had no problem in the past using this sort of model for forms which are not the main form, but for some reason, when I attempt to use this model for the main form, the message loop of the thread just quits. Here is my code for the threads message loop: procedure TController.Execute; var Msg : TMsg; begin while not Terminated do begin if (Integer(GetMessage(Msg, hwnd(0), 0, 0)) = -1) then begin Synchronize(Terminate); end; TranslateMessage(Msg); DispatchMessage(Msg); case Msg.message of // ...call different methods based on message end; end; To set up the controller, I do this: Controller := TController.Create(true); // Create suspended Controller.FreeOnTerminate := True; Controller.Resume; For processing the main form's messages, I have tried using both Application.Run and the following loop (immediately after Controller.Resume) while not Application.Terminated do begin Application.ProcessMessages; end; I've run stuck here - any help would be greatly appreciated.

    Read the article

  • Lightweight alternative to Manual/AutoResetEvent in C#

    - by sweetlilmre
    Hi, I have written what I hope is a lightweight alternative to using the ManualResetEvent and AutoResetEvent classes in C#/.NET. The reasoning behind this was to have Event like functionality without the weight of using a kernel locking object. Although the code seems to work well in both testing and production, getting this kind of thing right for all possibilities can be a fraught undertaking and I would humbly request any constructive comments and or criticism from the StackOverflow crowd on this. Hopefully (after review) this will be useful to others. Usage should be similar to the Manual/AutoResetEvent classes with Notify() used for Set(). Here goes: using System; using System.Threading; public class Signal { private readonly object _lock = new object(); private readonly bool _autoResetSignal; private bool _notified; public Signal() : this(false, false) { } public Signal(bool initialState, bool autoReset) { _autoResetSignal = autoReset; _notified = initialState; } public virtual void Notify() { lock (_lock) { // first time? if (!_notified) { // set the flag _notified = true; // unblock a thread which is waiting on this signal Monitor.Pulse(_lock); } } } public void Wait() { Wait(Timeout.Infinite); } public virtual bool Wait(int milliseconds) { lock (_lock) { bool ret = true; // this check needs to be inside the lock otherwise you can get nailed // with a race condition where the notify thread sets the flag AFTER // the waiting thread has checked it and acquires the lock and does the // pulse before the Monitor.Wait below - when this happens the caller // will wait forever as he "just missed" the only pulse which is ever // going to happen if (!_notified) { ret = Monitor.Wait(_lock, milliseconds); } if (_autoResetSignal) { _notified = false; } return (ret); } } }

    Read the article

  • Why my async call does not work?

    - by Petr
    Hi, I am trying to understand what is IAsyncresult good and therefore I wrote this code. The problem is it behaves as I called "MetodaAsync" normal way. While debugging, the program stops here until the method completed. Any help appreciated, thank you. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace ConsoleApplication1 { class Program { delegate int Delegat(); static void Main(string[] args) { Program p=new Program(); Delegat d = new Delegat(p.MetodaAsync); IAsyncResult a = d.BeginInvoke(null, null); //I have removed callback int returned=d.EndInvoke(a); Console.WriteLine("AAA"); } private int MetodaAsync() { int AC=0; for (int I = 0; I < 600000; I++) { for (int A = 0; A < 6000000; A++) { } Console.Write("B"); } return AC; } } }

    Read the article

  • Closing thread using ExitThread - C

    - by Jamie Keeling
    I have a simple program that creates a thread, loops twenty times and then makes a call to close itself and perform the necessary cleanup. When I debug the program it reaches the ExitThread(); method and pauses, ignoring the printf(); I have set up after it to signal to me it's closed. Is this normal or am I forgetting to do something? I'm new to threading using C. Main() void main() { Time t; int i = 0; StartTimer(); for(i = 0; i < 20; i++) { t = GetTime(); printf("%d.%.3d\n", t.seconds, t.milliseconds); Sleep(100); } StopTimer(); } Thread Creation void StartTimer() { DWORD threadId; seconds = 0; milliseconds = 0; // Create child thread hThread = CreateThread( NULL, // lpThreadAttributes (default) 0, // dwStackSize (default) ThreadFunc, // lpStartAddress NULL, // lpParameter 0, // dwCreationFlags &threadId // lpThreadId (returned by function) ); // Check child thread was created successfully if(hThread == NULL) { printf("Error creating thread\n"); } } Thread Close void StopTimer() { DWORD exitCode; if(GetExitCodeThread(hThread,&exitCode) != 0) { ExitThread(exitCode); printf("Thread closed"); if(CloseHandle(hThread)) { printf("Handle closed"); } } }

    Read the article

  • Java Version of Action Delegate invokeLater

    - by ikurtz
    the issue i mentioned in this post is actually happening because of cross threading GUI issues (i hope). could you help me with Java version of action delegate please? in C# it is done as this inline: this.Invoke(new Action(delegate() {...})); how is this achived in Java? thank you. public class processChatMessage implements Observer { public void update(Observable o, Object obj) { System.out.println("class class class" + obj.getClass()); if (obj instanceof String){ String msg = (String)obj; formatChatHeader(chatHeader.Away, msg); jlStatusBar.setText("Message Received"); // Show chat form setVisibility(); } } } processChatMessage is invoked by a separate thread triggered by receiving new data from a remote node. and i think the error is being produced as it trying to update GUI controls. do you think this is the reason? i ask because im new to Java and C#, but this is what is going on i think.

    Read the article

  • Legacy application creates dialogs in non-ui thread.

    - by Frater
    I've been working support for a while on a legacy application and I've noticed a bit of a problem. The system is an incredibly complex client/server with standard and custom frameworks. One of the custom frameworks built into the application involves validating workflow actions. It finds potential errors, separates them into warnings and errors, and passes the results back to the client. The main difference between warnings and errors is that warnings ask the user if they wish to ignore the error. The issue I have is that the dialog for this prompt is created on a non-ui thread, and thus we get cross-threading issues when the dialog is shown. I have attempted to invoke the showing of the dialog, however this fails because the window handle has not been created. (InvokeRequired returns false, which I assume in this case means it cannot find a decent handle in its parent tree, rather than that it doesn't require it.) Does anyone have any suggestions for how I can create this dialog and get the UI thread to set it up and call it?

    Read the article

  • What's the deal with the hidden Throw when catching a ThreadAbortException?

    - by priehl
    I'm going through a book of general c# development, and I've come to the thread abort section. The book says something along the lines that when you call Thread.Abort() on another thread, that thread will throw a ThreadAbortException, and even if you tried to supress it it would automatically rethrow it, unless you did some bs that's generally frowned upon. Here's the simple example offered. using System; using System.Threading; public class EntryPoint { private static void ThreadFunc() { ulong counter = 0; while (true) { try { Console.WriteLine("{0}", counter++); } catch (ThreadAbortException) { // Attempt to swallow the exception and continue. Console.WriteLine("Abort!"); } } } static void Main() { try { Thread newThread = new Thread(new ThreadStart(EntryPoint.ThreadFunc)); newThread.Start(); Thread.Sleep(2000); // Abort the thread. newThread.Abort(); // Wait for thread to finish. newThread.Join(); } catch (Exception e) { Console.WriteLine(e.ToString()); } } } The book says: When your thread finishes processing the abort exception, the runtime implicitly rethrows it at the end of your exception handler. It’s the same as if you had rethrown the exception yourself. Therefore, any outer exception handlers or finally blocks will still execute normally. In the example, the call to Join won’t be waiting forever as initially expected. So i wrapped a try catch around the Thread.Abort() call and set a break point, expecting it to hit this, considering the text says "any outer exception handlers or finally blocks will still execute normally". BUT IT DOES NOT. I'm racking my brain to figure out why. Anyone have any thoughts on why this isn't the case? Is the book wrong? Thanks in advance.

    Read the article

  • WPF: issue updating UI from background thread

    - by Ted Shaffer
    My code launches a background thread. The background thread makes changes and wants the UI in the main thread to update. The code that launches the thread then waits looks something like: Thread fThread = new Thread(new ThreadStart(PerformSync)); fThread.IsBackground = true; fThread.Start(); fThread.Join(); MessageBox.Show("Synchronization complete"); When the background wants to update the UI, it sets a StatusMessage and calls the code below: static StatusMessage _statusMessage; public delegate void AddStatusDelegate(); private void AddStatus() { AddStatusDelegate methodForUIThread = delegate { _statusMessageList.Add(_statusMessage); }; this.Dispatcher.BeginInvoke(methodForUIThread, System.Windows.Threading.DispatcherPriority.Send); } _statusMessageList is an ObservableCollection that is the source for a ListBox. The AddStatus method is called but the code on the main thread never executes - that is, _statusMessage is not added to _statusMessageList while the thread is executing. However, once it is complete (fThread.Join() returns), all the stacked up calls on the main thread are executed. But, if I display a message box between the calls to fThread.Start() and fThread.Join(), then the status messages are updated properly. What do I need to change so that the code in the main thread executes (UI updates) while waiting for the thread to terminate? Thanks.

    Read the article

  • How does lock(syncRoot) make sense on a static method?

    - by Rising Star
    The following code is excerpted from the (Windows Identity Foundation SDK) template that MS uses to create a new Security Token Service Web Site. public static CustomSecurityTokenServiceConfiguration Current { get { HttpApplicationState httpAppState = HttpContext.Current.Application; CustomSecurityTokenServiceConfiguration customConfiguration = httpAppState.Get( CustomSecurityTokenServiceConfigurationKey ) as CustomSecurityTokenServiceConfiguration; if ( customConfiguration == null ) { lock ( syncRoot ) { customConfiguration = httpAppState.Get( CustomSecurityTokenServiceConfigurationKey ) as CustomSecurityTokenServiceConfiguration; if ( customConfiguration == null ) { customConfiguration = new CustomSecurityTokenServiceConfiguration(); httpAppState.Add( CustomSecurityTokenServiceConfigurationKey, customConfiguration ); } } } return customConfiguration; } } I'm relatively new to multi-threaded programming. I assume that the reason for the lock statement is to make this code thread-safe in the event that two web requests arrive at the web site at the same time. However, I would have thought that using lock (syncRoot) would not make sense because syncRoot refers to the current instance that this method is operating on... but this is a static method? How does this make sense?

    Read the article

  • Invalid BOOT.INI (dual boot XP with 7)

    - by Muxa
    I had Windows XP x64 as my main system, and i also had a second partition with Windows XP x64. Both booted from first partition (C:) I then installed Windows 7 Ultimate on the first partition. I've added NTLDR using BCDRDIT. I've also copied NTLDR, NTDETECT.COM and BOOT.INI onto the drive where XP remained. However then i try to boot into Windows XP x64 i get Invalid BOOT.INI file Booting from c:\windows\ NTDETECT failed I found instructions on how to fix it using a boot disk, however the partitions are on a software RAID. I've tried to boot from a customized XP CD with the drivers, however it does not offer me a Repair option for some reason - just setup. Partitions that i have:'= System Reserved Main (Windows 7) Secondary (Windows XP x64) Here's the contents of my BOOT.INI: [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(3)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Windows XP Professional x64 Edition" /fastdetect

    Read the article

  • Mutli-processor workstation as a workstation/server

    - by posdef
    I work in a research institute and a number of programs we use are computationally intensive (I actually wrote one of them). Right now we have one computer that is dedicated for one of these programs (with local accounts only, as in users physically sitting in front of that pc) and the other programs are run on individual workstations assigned to people. I have been looking around to common brands such as Dell and HP, for a some sort of a small/medium scale server, which can be used as a workhorse by sending tasks remotely. It appears as if there is nothing in between workstations with one 6-core processor and a bunch of extras (like fancy graphics etc) and rack mount servers with ridiculous amount of RAM and HDD expansion capabilities but still relatively little number of processors/cores. I wonder if what I am looking for is such a small niche product? Are there other solutions that I might not be aware of? Does anyone know of a multi proc- multi-core workstation/server that is still within the reasonable

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >