In my application I have a simple module were I will read files for some process that will take
few seconds..so I thought of displaying a progress bar(using worker thread) while the files are in progress.I have created a thread (code shown below) and also I designed a dialog window with progress control.I used the function MyThreadFunct...
I'm using a thread that is continuously reading from a queue.
Something like:
public void run() {
Object obj;
while(true) {
synchronized(objectsQueue) {
if(objectesQueue.isEmpty()) {
try {
objectesQueue.wait();
} catch (InterruptedException e) {
...
In my application I have a simple module were I will read files for some process that will take
few seconds..so I thought of displaying a progress bar(using worker thread) while the files are in progress.I have created a thread (code shown below) and also I designed a dialog window with progress control.I used the function MyThreadFunct...
how does large text file viewer work?
I'm assuming that:
Threading is used to handle the file
The TextBox is updated line by line
Effective memory handling is used
Are these assumptions correct? if someone were to develop their own, what are the mustsand don'ts?
I'm looking to implement one using a DataGrid instead of a TextBox
I...
As we know each timer elapsed method callbacks on a separate thread. Is there a way to abort the timer thread in c#? Suppose a timer thread is blocked in a long running operation. How would a new thread abort the blocked thread? the Thread.CurrentThread points to the calling thread instead of the blocked thread.
...
Hi,
I have a program (C#) with a list of tests to do.
Also, I have two thread. one to add task into the list, and one to read and remove from it the performed tasks.
I'm using the 'lock' function each time one of the threads want to access to the list.
Another thing I want to do is, if the list is empty, the thread who need to read from ...
I have a class that inherits from SequentialWorkflowActivity, which can be executed simultaneously in multiple threads, and I need to make sure that part of the activity is
never interrupted
never executed across multiple threads
How can I do this in a WWF custom activity?
...
Hello everyone.
I'm new in Java so please forgive any obscene errors that I may make :)
I'm developing a program in Java that among other things it should also handle clients that will connect to a server. The server has 3 threads running, and I have created them in the following way :
DaemonForUI du;
DaemonForPort da;
DaemonForCheck ...
I have a COM library I should use in my ASP.NET MVC application. However I am unsure about its thread apartment model. How can I determine it?
...
Hello,
I have a multithreaded application written in c#. What i noticed is that implementing thread synchronization with lock(this) method slows down the application by 20%. Is that an expected behavior or should i look into the implementation closer?
...
I'm debugging an apparent concurrency issue in a largish app that I hack on at work. The bug in question only manifests on certain lower-performance machines after running for many (12+) hours, and I have never reproduced it in the debugger. Because of this, my debugging tools are basically limited to analyzing log files.
C# makes it ...
Hi,
I have a web-application which uses hibernate and for some reason every thread (httprequest or other threads related to queueing) uses a different session.
I've implemented a HibernateSessionFactory class which looks like this:
public class HibernateSessionFactory {
private static final ThreadLocal<Session> threadLocal = new ThreadL...
I want to create a Mono application to start and stop several processes. I only need to be able to start and stop the processes from the Mono application, I do not need any advanced features of managed processes. Users will be able to customize the available processes from a "preferences" menu.
The problem is, that I also need to be abl...
This is some challenge
On a single processor system, in which load and store are assumed to be
atomic, what are all the possible values for x after both threads have completed in
the following execution, assuming that x is initialised to O? Hint: you need to
consider how this code might be compiled into machine language.
for (int i = 0...
In my code I subscribe to an event that happens on a different thread. Every time this event happens, I receive an string that is posted to the observable collection:
Dispatcher currentDispatcher = Dispatcher.CurrentDispatcher;
var SerialLog = new ObservableCollection<string>();
private void hitStation_RawCommandSent(object...
How would I go about making a function that would do this in java.
String result = null
do
{
SendData()
// Run Blocking Function: ReceiveData() Until it returns a result
// or t seconds have elapsed
// if something returned, result = something
// else result = null
} while(result == null);
...
How can I update the JProgressBar.setValue(int) from another thread?
My secondary goal is do it in the least amount of classes possible.
Here is the code I have right now:
**Part of the main class....**
pp.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
...
I have a singleton NSOperationQueue that handles all of my network requests. I'm noticing, however, that when I have one particularly long operation running (this particular operation takes at least 25 seconds), my other operations don't run until it completes.
maxConcurrentOperationCount is set to NSOperationQueueDefaultMaxConcurrentOp...
I've been working on a pet project on the weekends to learn more about C# and have encountered an odd problem when working with localization. To be more specific, the problem I have is with System.Threading.Thread.CurrentThread.CurrentUICulture.
I've set up my app so that the user can quickly change the language of the app by clicking a...
What is the difference between synchronized methods and synchronized statements ?
If possible , please use an example to make it more clear.
Thanks.
...