# Slow Chat Archives > Slow Chat: Developing Multithreaded Applications >  Poll - Are you doing Multithreaded application development?

## Brad Jones

To get things started, I thought I'd toss out a poll for people to answer. 

If you answer yes in the poll, I'd be interested in hearing what types of things you are threading or running in parallel. I know that the obvious answers are things such as grpahics processing; however, I've heard a few great examples of other things that are being parallized such as virus checking. 

Brad!

----------


## Night_Wulfe

Currently I'm designing and prototyping an integration application that routes messages between other applications.  In addition to transferring messages between applications, it can perform processing tasks to retrieve, set, or generate information and transform messages from one type to another.

At its core, the application is multi-threaded so that it can process multiple messages simultaneously.  Although it won't be used initially, the design also allows the same message to be run through multiple, independent, processes simultaneously.

----------


## Lindley

I wrote a thread pool class some time back to support mathematically intensive computations. It uses pthreads internally, but tasks can be queued using either an interface resembling pthreads or one resembling Boost threads.

The hard part of the design was figuring out how to support a thread pool task creating *another* thread pool task, and subsequently waiting for it to complete. We don't want that thread to sit idle just because the task is in a waiting state.

What I ended up doing was using thread-local storage to give each task a priority, and incrementing to higher priority each time a task spawned another task. Then, when a task stopped to wait for another task to complete, any task with _at least as high_ a priority was allowed to take over the thread and run to completion. Then we'd check whether or not the waited-for task was done, and if so return the thread to the waiting task.

This worked well for the case when I needed to evaluate many nodes in a tree independently, and the computations of each node were themselves highly parallelizable. I could spawn each node as a task and have them in turn spawn sub-tasks, and everything worked seamlessly through a very simple interface.

I considered enforcing a stricter requirement that a given task could only have its thread borrowed by its own child tasks, but this would have been more complex to design, and there appeared to be no need for it in practice.

----------


## GeoRanger

I developed code to process the 2-dimensional outline of a transitional feature on a natural object in a fast-paced industrial environment.  Although the algorithm to do this is quite straightforward, making it multi-threaded was significantly more difficult because certain inflections in the outline imply an order in which the outline must be processed.  I solved the problem with a carefully-crafted binary tree which is able to direct threads in a worker queue to specific parts of the outline in the correct order.

The result of that process can loosely be thought of as a "map" upon which a combinatorial algorithm must operate.  I developed code to permute carefully ordered sets in the map and pass the permutations to worker threads, which must in turn communicate a job status amongst each other so they can rapidly shut down when the algorithm is complete, in order to turn the CPU back over to other parts of the application (as the functionality I implemented is only a part of a larger computationally-intensive process, the whole of which must be fast).

----------


## Marc G

I have used multithreading for a long time, going back to Windows 95 even.
Mostly I use it to keep the UI responsive will compute intensive tasks are being done in separate worker threads. What I did in threads is things like image processing, thumbnail generation, web services to handle requests in different threads, 2G/3G software running at operators datacenters to enable internet and MMS on cellphones and so on.

----------


## Tech. Explorer

i am working in stock market applications. we have a net work library based on IOCompletion port. The library is working fine with real time huge data, however the organization has a plan to upgrade its library. I want to know which technology should we use to improve performance and reliability.

----------


## dglienna

I used VB6 to create two programs, to simulate parallel processing.

The app would search each letter of the alphabet for the last name, and each of the letters of the first name.

Prog#1 spun up 26 instances of Prog#2, and they all ran at the same time.

It would have been nice to be able to have Prog#2 run in parallel, which should be possible, now.

EDIT:  Also had an experience with Powershell 2.0.   I had a loop routine that dialed a modem, and PS decided to execute them in parallel.  Had to find the /s flag

----------


## VictorN

I use multithreading but only when I *really* need it:
to work with serial portsto support waitable timersto implement socket (and other types of IPC) communicationsand so on

----------


## minitech

I always run game loops in a separate thread or separate threads.

----------


## BobScarle

I have been writing threaded applications for a long time. My current project is an app for switch programming. It reads a script file and writes to the switch, all done in a seperate thread.

Bob

----------


## kyewooklee

I have been writing multi thread program in verious way. For machine interface, I have used visual C. On linux, I made delay process for Order-claim system calld "Margine Manager". Now I am making "Queue Manager" C# multi thread.

----------


## JohnW@Wessex

Our applications monitor and take images from items on a high speed conveyor.
There are usually four or five threads.


System thread (Highest priority)
Handles 1ms timer.
Tracks items on the conveyor.
Coordinates activities of the other worker threads.Acquire thread
Handles acquisition of imagesAnalysis thread (one or more)
Analyses the images, may be one thread for each core/image.GUI thread (Lowest priority)

----------

