Lucky for you threads are quite simple in Builder. Just create a descendant from the TThread class by writing a Execute method. CBuilder will make the basic file for you from File->New, New Tab at the bottom - Thread Object.
The CBuilder helpfile is quite useful as well. Look under 'TThread' and also 'Using TThread'
Borland Example files in the Borland ..\Borland\CBuilder5\Examp
Heres a small tutorial
http://www.temporaldoorway
Another basic thread example
http://cc.borland.com/ccwe
To get this one to work just make a new project and stick in Unit1 and Unit2. It has a project but it is more work to clean it up to compile and run. Unit2 is a very basic TThread class example and Unit1 is a GUI frontend to start and stop the threads.
Also chapter 7 of the Developers guide (that came with my CBuilder5) covers threads - not sure if v6 also has the book. I think there is a chapter in the CBuilder 5 or 6 Developers Guides as well. Useful books in any case.
As gtokas mentions there may be some components that do most of the thread management work for you depending on what you are doing. eg most internet servers.
Main Topics
Browse All Topics





by: gtokasPosted on 2005-03-10 at 13:29:13ID: 13511062
Hello there...
Server?? What kind??
If it is TCP/IP then:
Drop a TServerSocket at your form(Internet tab)...
By default the connection type is nonblocking...
THAT MEANS each connection to the socket executed at its own thread...
Those are for your information...
It is a bit different than MFC... Anyway those sockets at the internet tab are wrappers around winsock... They handle MOST of your needs ...
One more thing.. At BCB\Examples\Internet you will find an example called chat...
Explore it and feel free to post again if you have questions...
gtokas.