[Qt-interest] TcpServer: fork or threads?

Josinei Silva josinei_listas at yahoo.com.br
Mon Feb 2 14:39:41 CET 2009


Hi,

I need to create a program that will be a tcp server for extract data from a 
PostqureSQL database for some users. Each operation is independent from the 
ohters, no comunication between one extraction to anothers. Each one will 
generate a file with data extracted and returns it thru the tcp connection 
opened by user.

What's the best way to make this program works without serialize the user's 
requests, fork ou threads?

I found some documentation about threads at Qt documentation and another web 
pages. But almost nothing about Qt and fork.

Its safe to use fork with Qt, tcp sockets and sql module? It''s better to use 
threads even with no communication between each request?

It's my first time with tcp servers and threads or forks. So, i'm looking for 
clues about what way i should follow.

Thanks

Josinei



More information about the Qt-interest-old mailing list