Hi all, I'm studying on a traffic simulation project right now. However i have problem with pausing the threads. Each car is considered as a thread in my app. When the simulation is running i want to pause it. Thread.suspend( ) method doesnt work, since i have to stop the thread from altering data. Let's say if there is a car on the road, and i click on pause button, the car should stay there.
Any ideas ?
Thanks in advance.
Search Result
Collapse
20 results in 0.0044 seconds.
Keywords
Members
Tags
-
How to pause and resume a thread?
-
update a few components from a thread
I need a thread to populate a listview and to increase/update the values of two progress bars (in vb.net)
For better understanding, the form looks like this:
Can anyone help me out, I tried to use a backgroundworke r, something like this:
Code:Private Sub btnGO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGO.Click pbAction.Value = 0 bgwProcess.RunWorkerAsync()
-
Thread Not Working
Can somone tell me why richtextbox text is not changing?
Code:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Thread t = new Thread(rtb2); t.Start(); } private
-
How can I debug a form calling an openFileDialog?
Gentle Advisors,
I have a form where a button selects an image and passes it on a control of this form and an other one.
I wanted to debug the statements but I got an error message at the source lineCode:if (openFileDialog1.ShowDialog() == DialogResult.OK)
"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttrib ute marked on it.... -
problem with multi-threading parameters ( C pthread )
Hi, I'd like to create thread wich call one function
this function takes a structure (2dArray) in its parameter and return another structure (Path).
the prototype looks like this :
Path function1 (2dArray);
I have problems because the threads parameters are (void *(void *)) and return void* -
Showing "Work in progress" window while copying files
Hi!
I'm writing an application in which I'm copying a few files. It takes a while, that's why I would like to open a window which would say "Work in progress", so the user would know that copying is in progress and he should wait until it finishes. After finishing the copy-progress, the little notification window should close and let the user continue the work with the application.
I tried to solve this, but when I... -
Solution for handling boost::thread with member functions
I'm using VC++ 2010 with Boost 1.43.
I've just created a class that uses winsock to handle network communication. Now there's a method called "fillQueue" which is defined like this:
Code:void fillQueue(NetworkQueueTS& nq);
-
WHy my emulator blocks even when I use thread?
I am trying some thread tuts in J2me and camee across this code on the Net. Whan I run it, the emulator blocks... What is the use of the thread when the application still blocks...And How do I make this work?
Code:import java.io.IOException; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable;
-
Unable to thread functionality
Hi
I'm trying out a simple threading application, wherein, I try to detect a list of Bluetooth users in the vicinity.
In its implementation, I've got a Swings form, which contains a 'Start' button and a TextArea.
On clicking 'Start', I look for the devices by calling a method detectData, which has an implementation of its own. When this happens, I ought to have a "Searching for devices..." message... -
Populate TreeView in Background worker
In vb2005, I have to load a treeview control while loading the form so make the form loading more effective therefore I use Background worker to populate treeview. I tried treeview to pass by ref and faced the error “Cross thread operation not valid: Control” accessed from a thread other than the thread it was created on..”, which makes sense.
Now I want to load treeview in background and return its object then assigning it : Is this... -
Send timeout message to parent thread without terminating parent thread
I'm trying to setup a mechanism to read input from a source, but time out after 10 seconds of inactivity from that source. After the mechanism times out, I want to run some end processing on the input.
I have 2 classes:
1. Main thread.
2. Timer class.
Currently, the timer class times out like so:
Code:public void timeout() { System.err.println ("Output finished. terminating");
-
Thread not starting on some machines
Hi guys,
I have a weird issue here. I'm writing an automated backup program that, well, performs automated backups of set folders to a set location. It has a GUI and a Windows service. The service has a timer (system.timer) that checks every 10 seconds whether a backup needs to be performed. If it does, it fires a method in a public static class to start the backup.
Now, this works fine on my PC, and on 2 other test... -
Thread suspend and resume methods. Alternatives?
Hello again, I would like to put my thread on hold and check the data that the threaded process' event passed to my other class. I am using suspend and resume methods, but the VS says they are obsolete. What should I do? Should I use Sleep with all the time incremental dynamic time slice or there are other ways?
Thanks, EARNEST. -
Playing sound thread sync with other codes ?
Hello all,
I have small sized mp3 files that i can play via Java using JLayerPlayer that takes the address of mp3 files , JLayerPlayer objects can be played creating threads and starting. The problem is when i have for example 9 sounds and i want it them to play in consecutively , so i put them in for loop like:
for(int i=1;i<mainNotaL ist.size()+1;i+ +)
{
neyBox1.arrange NeyImage(mainNo taList.get(i-1));... -
Are Threads Finished?
for(int i=1;i<mainNotaL ist.size()+1;i+ +)
{
Thread currentThread=n ew Thread(porteImg s[i].getNotam().get SoundLayer());
porteImgs[i].activate();
porteImgs[i].repaint();
currentThread.s tart();
try {
currentThread.j oin();
} catch (InterruptedExc eption ex) {
Logger.getLogge r(Ney1View.clas s.getName()).lo g(Level.SEVERE,...