I will try to keep it simple:
In my main activity I make a handler:
public class ARViewer extends ARDisplayActivity {
public final MHandler mHandler = new MHandler(this);
public void onCreate(Bundle savedInstanceState) {
...
The class MHandler:
public final class MHandler extends Handler{
//main activity
private ARV...
All,
I'm looking for recommendations for C or C++ libraries (preferably open source) that use multi-threaded techniques to multiply large, non-square, (e.g. 65536xn in size where n < 65536) non-sparse matrices. Thanks.
-&&
...
Here's an interesting one - in VS2005 / VS2008 running against .NET 2.0 / .NET 3.0 / .NET 3.5, a BackgroundWorker thread may not directly update controls on a WinForms form that initiated that thread - you'll get a System.InvalidOperationException out of the BackgroundWorker stating "Cross-thread operation not valid: Control 'thecontrol'...
Hi all,
I have a requirement where I am planning to run a background process.
Once user logs in into application, I need to have two processes done.
1. authenticate user and go to homepage
2. Get some data and put it in session.
If I do both at same time its going to take 10 minutes to get to homepage. Instead I want second process to...
When my app starts, it checks to see if it has stored login credentials. if it doesn't, it starts another activity to prompt the user for those credentials. My problem is, that when the prompt activity is started, the first activity continues execution and ends up with null pointers because the prompt activity has not yet returned the ne...
Hello. I'm getting an error that does not make sense.
Cross-thread operation not valid: Control 'buttonOpenFile' accessed from a thread other than the thread it was created on.
In my application, the UI thread fires off backgroundWorker1, which when almost complete fires off backgroundWorker2 and waits for it to complete. backgroundW...
I am trying useing futures for the first time. It seems smart that you can cancel a job but it is not working as expected. In the example below only the first job is cancelled. The rest are completed. Have I missunderstood the use of futures?
public class ThreadExample
{
public static void main(String[] args) throws InterruptedExce...
I'm a little new to threading, so you'll have to forgive the naiveté of this question.
How is pthread_join implemented and how does it effect thread scheduling?
I always pictured pthread_join implemented with a while loop, simply causing the calling thread to yield until the target thread completes. Like this (very approximate pseudoc...
I'm trying to switch the class loader at runtime:
public class Test {
public static void main(String[] args) throws Exception {
final InjectingClassLoader classLoader = new InjectingClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
Thread thread = new Thread("test") {
publi...
how can i do in C# that my function will be guarded by mutex semaphore a.k.a synchronize function in JAVA
...
I have three classes:
class Rtss_Generator {
int mv_transfersize;
}
class Rtss_GenSine : Rtss_Generator
class Rtss_GenSineRpm : Rtss_GenSine
Rtss_GenSine creates a thread in his constructer, it is started immediatly and the threadfunction is off-course declared static, waiting for an event to start calculating.
the problem: all t...
In my application I have to send periodic heartbeats to a "brother" application.
Is this better accomplished with System.Timers.Timer/Threading.Timer or Using a Thread with a while loop and a Thread.Sleep?
The heartbeat interval is 1 second.
while(!exit)
{
//do work
Thread.Sleep(1000);
}
or
myTimer.Start( () => {
...
Suppose I have a C(++) function taking an integer, and it is bound to (C)python with python api, so I can call it from python:
import c_module
c_module.f(10)
now, I want to parallelize it. The problem is: how does the GIL work in this case? Suppose I have a queue of numbers to be processed, and some workers (threading.Thread) working ...
Hello,
I have a thread that gets executed when some action occurs. Given the logic of the program, the thread cannot possibly be started while another instance of it is still running. Yet when I call it a second time, I get a "RuntimeError: thread already started" error. I added a check to see if it is actually alive using the Thread.is...
I have this strange issue with some third party DLL's. The third party provider references some open source DLL's that have a memory exception whenever I try to use a certain method. This issue does not appear when the app is run on a single core machine, but obviously we cannot assume a user will have that.
Is there a way to force an ...
Hello, I have a thread which produces some data (a python list) and which shall be available for a widget that will read and display the data in the main thread.
Actually, I'm using QMutex to provide access to the data, in this way:
class Thread(QThread):
def get_data(self):
QMutexLock(self.mutex)
return deepcopy(self.data)
...
Suppose i have pointer to a thread like this
CWinThread *m_pThread = AfxBeginThread(StartThread, this, THREAD_PRIORITY_NORMAL, 0, 0);
Now in my StartThread function assume i did all operations and the function returned like this
UINT CClassThread::StartThread(LPVOID pVoid)
{
return true;
}
Will my m_pThread be invalid when the...
I guess, DAO is thread safe, does not use any class members.
So can it be used without any problem as a private field of a Servlet ? We need only one copy, and
multiple threads can access it simultaneously, so why bother creating a local variable, right?
...
There's a bit of code which writes data to a MemoryStream object directly into it's data buffer by calling GetBuffer(). It also uses and updates the Position and SetLength() properties appropriately.
This code works properly 99.9999% of the time. Literally. Only every so many 100,000's of iterations it will barf. The specific problem i...
Python interpreter has a Global Interpreter Lock, and it is my understanding that extensions must acquire it in a multi-threaded environment. But Boost.Python HOWTO page says the extension function must release the GIL and reacquire it on exit.
I want to resist temptation to guess here, so I would like to know what should be GIL locking...