Click here to Skip to main content
13,055,884 members (49,881 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am working on a udp client-server application where one server is supposed to handle 40 clients which could all be logged on at once as well...
Now in "unix" such issues are resolved by using "fork()" function which basically creates a child process to deal with the client and leaves the server to accept new connections...
I searched on the internet and found out that an exact analogous of "fork()" is not available in windows, however "CreateProcess()" could be used...
My previous research also introduced me to "thread pool" so now I've two questions:
1)Could I acheive the functionality of "fork()" by "CreateProcess()" in windows.
2)if this is possible,what should I do go for: threadpool or creating multiple processes ?

looking forward to the response...
Posted 17-Apr-13 23:44pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

(1) Both CreateProcess and fork creates a new process. However fork duplicates the calling process, while CreateProcess starts an executable. Both function allows the implementation of a multiprocess server.

(2) Usually such servers are multithreaded, however nothing prevents you to make it multiprocess instead.
Just be aware that inter-process communication is heavier.
Aayman Khalid 18-Apr-13 5:58am
So that means I should go for threadpool in order to save the processing power?
CPallini 18-Apr-13 6:08am
You might. Have a look at this page:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 18 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100