I'm developing a class library in .NET that other developers will consume eventually. This library makes use of a few worker threads, and those threads fire status events that will cause some UI controls to be updated in the WinForms / WPF application.
Normally, for every update, you would need to check the .InvokeRequired property on W...
Hi,
I'm currently returning a stream from all my WebGet/WebInvoke decorated methods from WCF. And I also get a stream as input. I do this because I want flexibility with response & input content types. This is primarily because I need flexibility when parsing the input - it cannot be easily serialized / deserialized.
However I then use...
I must port a project to the compact framework. And can not convert to
ThreadPool.RegisterWaitForSingleObject
(WaitHandle, WaitOrTimerCallback,
object, int, bool)
What may be a alternative way for ThreadPool.RegisterWaitForSingleObject in c#
lock (this.RegLock)
{
if (!this.WaitFlag)
{
this.mre.Reset();
...
In other words, can I do something with a volatile variable that could not also be solved with a normal variable and the Interlocked class?
...
Hi,
I have created an Add-In in C# that implements user defined functions for Excel.
These UDF's return immediately, but they control background asynchronous procedures.
These procedures have status that needs to be monitored and presented to Excel.
I have chosen to display the status using checkboxes.
A background thread then update...
So I'm running perl 5.10 on a core 2 duo macbook pro compiled with threading support: usethreads=define, useithreads=define. I've got a simple script to read 4 gzipped files containing aroud 750000 lines each. I'm using Compress::Zlib to do the uncompressing and reading of the files. I've got 2 implementations the only difference betw...
My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function.
At the moment I am using TerminateThread() to kill that thread but it's causing it to hang sometimes.
I know there is a way to use events and WaitForSingleObject() to make t...
Does the ExecutorService guarantee thread safety ?
I'll be submitting jobs from different threads to the same ThreadPoolExecutor, do I have to synchronize access to the executor before interacting/submitting tasks?
...
When a thread throws an exception that is unhandled, it terminates. What is the proper way to handle exceptions thrown on threads and how to propogate relevant exception data to other parts of the code that would need to subscribe to notifications? Is there an INotifyThreadPoorlyDesigned interface that I missed somewhere?
Same applies ...
I was wondering if i could safely read from an XmlDocument object using SelectNodes() and SelectSingleNode() from multiple threads with no problems. MSDN says that they are not guaranteed to be thread safe. If SelectNodes() and SelectSingleNode() do present problems running from multiple threads, could i use proper locking to avoid any...
EDIT
I solved the issue by forking the process instead of using threads. From the comments and links in the comments, I don't think threading is the right move here.
Thanks everyone for your assistance.
FINISHED EDIT
I haven't done much with threading before. I've created a few simple example "Hello World" scripts but nothing that ac...
okay, so here is what im doing:
class Connection
{
public int SERVERID;
private Thread connection;
public Connection()
{
connection = new Thread(new ThreadStart(this.Run));
}
public void Start(int serverid)
{
SERVERID = serverid;
connection.Start();
}
void Run()
{
w...
Hi,
I'm creating an Appdomain to run a piece of code that can literally be any thing. I want my host process to be able when all the word is complete but async calls/threads are blocking my efforts. My code is something like this:
AppDomain ad = AppDomain.CreateDomain(...);
WorkUnit mbro = (WorkUnit)ad.CreateInstanceAndUnwrap(...);
mb...
I am reviewing code which creates a lot of threads. CreateThread documentation on Windows says that a all thread creation calls are serialized within a process. To estimate the performance impact of such code, I wonder how long does CreateThread take to run? I understand this depends on the number of DLLs already loaded into the process,...
Hi,
i was trying to write a simple multithreaded program. It is dumping the core. I have my function that is called when a thread is created below:
void *BusyWork(void *t)
{
int i;
int *tid;
int result=0;
tid = t;
printf("Thread %d starting...\n",*tid);
for (i=0; i<10; i++)
{
result = result + (i* i);
}
...
this might a simple query.
when we are creating a thread we are passing the (void *)t as an argument to a function PrintHello.we are copying the value in the pointer threadid(typacasting it to long) in tid which is a long variable again.i am confused with the parameter passing.
is this a pass by reference or pass by value.over all is t...
How does one create a Kernel Thread using Posix library?
...
I have searched for related topic, but still can't solve the problem...
use threads;
my $person = new Person( 'Name' => "yy");
my $udp_thread = threads->new(\&udp_func);
while(1)
{
$person->working();
}
sub udp_func
{
#Can't call method "setName" on an undefined value:
$person->setName();
}
How can I visit...
I write server application (Windows Server 2003) making upto 1000 ping calls to clients and waiting for receive responses. As ping uses ICMP connection, I've found no way to define from which IP the server receives the responses. Currently I use blocking by Mutex but it practically removes all bonus of multhithreading. Is there another w...
I am a beginner on Stack Overflow.
I am working on a Unix platform in C/C++.
Knowing basic programming in these regards how could I start with multithreading?
Multithreading seems to be very interesting and I want to grow my knowledge in this regard.
How could I get started with multithreading and what are the best techniques/books/ebo...