uses for wxthread

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply

How many wxThreads do you have in your program?

None
1
8%
1-10
7
58%
10 or more
4
33%
 
Total votes: 12

travfar
Earned some good credits
Earned some good credits
Posts: 132
Joined: Mon Apr 04, 2005 12:54 am
Location: California
Contact:

uses for wxthread

Post by travfar »

This might sound like a dumb question...

What should a wxThread be used for?
I see said the blind man to the deaf girl who was mute.

Visit my project at: http://vwp.sourceforge.net

wx version:2.6.2 and 2.6.3 on linux
OS's:Windows XP, Gentoo is the best!!!!!!
compiler:Codeblocks(MingW32) and gcc on linux
mjs
Experienced Solver
Experienced Solver
Posts: 93
Joined: Wed Feb 09, 2005 3:53 am
Contact:

Post by mjs »

It depends on the CPU time consumption of every thread and the required wake-ups per second.

Regards,
Mark
megabyte
I live to help wx-kind
I live to help wx-kind
Posts: 196
Joined: Tue Dec 07, 2004 8:54 pm
Location: Essen, Germany

Re: uses for wxthread

Post by megabyte »

travfar wrote:This might sound like a dumb question...

What should a wxThread be used for?
There are several situations. An application can contain a several inherited from wxThread classes and uses the only instance of the every inherited class. For example, a programm contains a CReaderThread class to read a big amount of data from a file and in parallel displays progress information in a status bar. After the reading process the application handles the data in some way using an instance of the wxThread inherited class (for example CDataHandleThread) to give someone ability to see the handling progress and stop this process.

From other hand, if the data handling task is easy to split on parallel subtasks, then the application creates several instaces of a CDataHandleWorkerThread class to handle the data and one thread to manange all the worker threads. Very often the number of the worker threads equal to a processors number of a computer.

The text above contains simple examples how to use the wxThread class, there are a number of other more complex examples.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Funny poll ... if a person selects NONE his background on GUI programming is most likely questionable. There is always one thread in your app, wether you like it or not ;-)

Interesting poll though. I worked with threads a lot (and still do) but not in my wxWidgets apps. There was no need for it, I can imagine when creating an internet app of some kind, it would be the way to go to put a connection in a thread (at least at the server side)..

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post by Ryan Norton »

Jorg wrote:Funny poll ... if a person selects NONE his background on GUI programming is most likely questionable. There is always one thread in your app, wether you like it or not ;-)
Well, the main wxThread is NULL, so I think it would be technically correct on windows 8)
[Mostly retired moderator, still check in to clean up some stuff]
Tyler
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 246
Joined: Fri Sep 03, 2004 12:37 am
Contact:

Post by Tyler »

In one of my applicatoins I use 20-30 threads to crawl over the network. Each thread performs some function with a host. Parallel execution in this fashion is orders of magnitude quicker then processing without multithreading.
mispunt
Experienced Solver
Experienced Solver
Posts: 59
Joined: Tue Oct 19, 2004 3:23 pm
Location: Ede, Holland

Post by mispunt »

Jorg wrote:Funny poll ... if a person selects NONE his background on GUI programming is most likely questionable. There is always one thread in your app, wether you like it or not ;-)
Whell I pu that none, because I am not doing it hard coded in it... :lol:
Post Reply