multithreading

Functional Requirements for the ultimate web development framework?

With the wide variety of web development frameworks that are available, there always seems to be a perpetual incentive to "try something new". Hence, some of us find ourselves trading one framework for another, never being entirely satisfied with the end results. Granted there will always be niches where a given web framework will serv...

What is the best way to search multiple sources simultaneously?

I'm writing a phonebook search, that will query multiple remote sources but I'm wondering how it's best to approach this task. The easiest way to do this is to take the query, start a thread per remote source query (limiting max results to say 10), waiting for the results from all threads and aggregating the list into a total of 10 entr...

Exception when loosing a thread

I start two threads with a Timer and TimerTasks Timer timer = new Timer(); TimerTask task = new TimerTask() { public void run() { doSomething(); } }; Calendar start = Calendar.getInstance(); timer.scheduleAtFixedRate(task, start.getTime(), 1000 * 60 * 60); Now sometimes the second ...

i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was running stops... Please help me out to solve this as i want to run this program continously... ...

Process vs Thread

Recently I have been asked question in the interview whats the difference between process and thread. Really I did not know answer. I thought for a minute and gave very weird answer. Threads share same memory.. processes do not. After answering this interviewer gave a evil smile and fired following questions at me: Q. Do you know segm...

axapta thread / animation

Hi folks, i have a function which costs plenty of time. this function is an sql-query called via odbc - not written in x++, since the functional range is insufficient. while this operation is running, I want to show an animation on a form - defined in the aviFiles-macro. trying to realize, several problems occur: the animation doesn'...

How to advance a progress bar from a recursive method while avoiding threading issues?

I made this code example which successfully uses a BackgroundWorker to advance a progress bar in a for loop. Now I'm trying to adapt it to work with the following recursive file copy method so that it shows me how far along the copying is, but the following code is giving me the error "This BackgroundWorker is currently busy and cannot ...

Is there any way that Enter/LeaveCriticalSection could leave a handle behind

I have the following code in my program: EnterCriticalSection(&critsec[x]); // stuff LeaveCriticalSection(&critsec[x]); It works fine 99.999% of the time but occasionally a handle seems to get left behind. Now I have done the obvious things like make sure that x did not change value between the enter and make sure that there isn...

C# Can Multiple Classes LOCK the Same Object using multiple References?

Hi all, I want to make multiple instances of this class. public class Worker { private object _lockObject; private Thread _workerThread; private string _name; public Worker(object lockObject, string name) { _name = name; _lockObject = lockObject; _workerThread = new Thread(new ThreadStart(Do...

Multi Threading in an Infopath Browser Enabled Form

I have a browser enabled infopath form running within the XmlFormView control on a custom ASP.Net page in SharePoint. The form needs to open a new browser window to perform some action and then act on a returned value from the browser window. Currently using NotifyHost to tell the custom aspx page to render a window.open() javascript f...

Calling C like callback within a thread

Hi; I have a C static library with, A callback definition: typedef void (*HandleEvents) (enum events eventID, int msgSize, char *msg); A function in the library: int init(HandleEvents _handleEvents) And another C++ GUI developed in VS. which links this static lib and calls init function of the lib giving a function pointer. ini...

WCF - starting a new thread asynchronously

Setup WCF Service running in IIS 6 Caching - Enterprise.Caching There's a business need to hold on to a message for a x amount of time(cache). Another process will remove it from the cache. We may receive another message that will remove this message from the cache and prevent it from processing. One way that I though of doing this i...

What will it take for Transactional Memory to be viable?

I've been doing some work on transactional memory and its viability for systems programming (databases, operating systems, servers, etc.). My own experience employing transactions, together with having seen how few communities use transactions in real code, has raised a question: What would convince you, a developer writing production co...

How to force multiple commands to execute in same threading timeslice?

I have a C# app that needs to do a hot swap of a data input stream to a new handler class without breaking the data stream. To do this, I have to perform multiple steps in a single thread without any other threads (most of all the data recieving thread) to run in between them due to CPU switching. This is a simplified version of the si...

Should I read file in separate thread in this case ?

Hi, I am writing an application for embedded linux where 5% of processor time is going in reading a file and 95% on processing it. Can I get some performance improvement if I read file in one thread and keeps on processing in another thread? I am reading from mmc card which has DMA support. Filesize is of 20mb and it is devided in chun...

IllegalStateException shutting down webapp with PicoContainer

I have a Java webapp that's using PicoContainer for dependency injection. When I shut down the app, I sometimes get the following stack trace repeated a few times in my error log: 2009-11-18 17:32:29,352 ERROR [/] - Session event listener threw exception java.lang.IllegalStateException: Cannot stop. Current container state was: STARTE...

copy file in a thread

I am trying to write to copy a file by invoking a separate thread. Here is my form code: unit frmFileCopy; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls; type TForm2 = class(TForm) Button3: TButton; procedure Button3Click(Sender: TObject); proc...

Thread Synchronization Scenario Feedback

I need some feedback on a threading problem that I am trying to solve. The problem (this is coded as a winform application in C#) I am comparing to lists which should be identical - if there is a discrepancy I popup a window and get the user to resolve the discrepancy by indicating which items are new and which items were deleted. The i...

How does one start a thread in Clojure?

I've read a lot about how great Clojure is when it comes to concurrency, but none of the tutorials I've read actually explain how to create a thread. Do you just do (.start (Thread. func)), or is there another way that I've missed? ...

About grouping sql queries in django…

Hello! I found an ambiguous place in one django-based application that I use in my project, please look at that: if not request.method == 'POST' or not request.POST.get('openid'): raise RedirectException(next, _('Invalid POST data')) if not UserAssociation.objects.filter(user=request.user).count() > 1 and not request.user.email: ...