Can I get a threads suspend count under Windows CE, using C or Visual C++, without calling resume or suspend functions? The only way I can see of doing it is something like
int Count = SuspendThread(ThreadHandle);
ResumeThread(ThreadHandle);
This has a couple of problems, firstly, I'd rather not suspend the thread, and secondly the...
I need to build a system of workers (represented as threads) and (multiple) queues. Individual jobs are waiting in one of the queues and waits for a worker thread to process them. Each worker can process jobs only from some of the queues. No spin-waiting. C/C++, pthreads, standard POSIX.
The problem for me is the "multiple queues" thing...
Exact duplicate of Using OpenNETCF.Net.Ftp inside a class instead of inside a Windows Form
So far I am using an FTP object inside a Windows form. FTP object runs in a separate thread, so to ensure that my app doesn't freeze up, I use the following piece of code:
private void OnResponse(string response)
{
if (this.InvokeRe...
good evening!
currently i'm developing a wpf-client for some rest-service. the communcation with the rest-service is no problem and is done in an extra assembly (communcation-interface).
basically:
i have a somehow "search"-button which executes a method. this method communicates with the service, updates some textboxes and a progress-...
I have a method that for thread-safety reasons should only ever be used by a particular thread. If another thread tries to use it, I would like an exception to be thrown.
public void UnsafeMethod()
{
if (CurrentThreadId != this.initialThreadId)
throw new SomeException("Can only be run on the special thread.");
// continu...
I want to have create NIOServer which reads data from client using 1 thread and writes data to the client using another thread.
also accepting client connection will be in some other thread.
Is there any online help
Thanks
Deepak
...
I am writing a C# console application that connects to a server trough TCP, it uses a separate thread to listen for incoming messages from the server and I want it to write them to the console while at the same time reading a message from the console. I was able to do that, but I have a problem.
The console displays this while I type an...
I need to implement a background process that runs on a remote windows server 24/7. My development environment is C#/ASP.NET 3.5. The purpose of the process is to:
Send reminder e-mails to employees and customers at appropriate times (say 5:00PM on the day before a job is scheduled)
Query and save GPS coordinates of employees w...
When performing many disk operations, does multithreading help, hinder, or make no difference?
For example, when copying many files from one folder to another.
Clarification: I understand that when other operations are performed, concurrency will obviously make a difference. If the task was to open an image file, convert to another for...
Does anyone ever see alot of errors like this:
Exception `Net::HTTPBadResponse' at /usr/lib/ruby/1.8/net/http.rb:2022
- wrong status line: SOME HTML CODE HERE
When using threads and mechanize? I'm relatively certain that this is
some bad behavior between threads and the net/http library, but does
anyone have any advice as far as the upp...
I am looking for a way to determine for a thread on which other thread it was originally spawned. I do not know whether a mechanism exists to do this, similar to the "Parent" property on Tasks in the new Task Parallel Library for .NET 4
Edit:
Further investigation actually seems to indicate that there is no location to store this inform...
I'm using the following code to write data through a named pipe from one application to another. The thread where the writing is taken place should never be exited. But if r_write() returns less than it should, the thread/program stops for some reason. How can I make the thread continue once write has returned less than it should?
ssize...
IronPort developed a stackless threading model that allows the IronPort appliance to support more than 10,000 simultaneous connections in contrast to the 100 connections supported on a traditional OS.
If one wanted to do the same but to make it open source, where should they start?
...
How do I set a name to a Win32 thread. I did'nt find any Win32 API to achieve the same. Basically I want to add the Thread Name in the Log file. Is TLS (Thread Local Storage) the only way to do it?
...
I built a Testbox to learn something about threading in windows form applications.
Silverlight and Java are providing the Dispatcher, which really helps when updating
GUI Elements.
Code Samples:
Declaration Class Delegate
public delegate void d_SingleString(string newText);
Create Thread
_thread_active = true;
Thread...
Before answering, it is not as easy question as you might have thought about when you read the title.
I have an ItemsControl which is binded to an ObservableCollection of T and data being described as a DataTemplate. So far it is a classic case.
When I add a new element I need to know the exact coordinate and positions inside the windo...
How do I write a windows service in c# that listens for tcp connections and processes these connections? The problem is that I want a better method than to "block" in the main thread e.g.
while(true) ;
I can start the listener on another thread but the main thread needs to block to prevent the application from exiting (and the ser...
Hi all,
I have a windows forms application in .NET 3.5. There's one form with 20 picture boxes. There's also an array with 20 image URL's. The goal is to loop through the array of URL's and load the images from the web into the picture boxes.
I tried having a standard foreach loop and use the picture box LoadAsync() method, but it does...
Currently, I have something like:
public partial class Form1 : Form
{
delegate void StringDelegate(string value);
private FTP m_ftp;
public Form1()
{
InitializeComponent();
}
private void connect_Click(object sender, EventArgs e)
{
OnResponse("Connecting");
m_ftp = new FTP(server.Text);
m_ftp.ResponseReceived += new FTPResponseHandle...
I have several thread pools and I want my application to handle a cancel operation.
To do this I implemented a shared operation controller object which I poll at various spots in each thread pool worker function that is called.
Is this a good model, or is there a better way to do it?
I just worry about having all of these operationC...