Re: advices on sockets
- From: "jason.cipriani@xxxxxxxxx" <jason.cipriani@xxxxxxxxx>
- Date: Mon, 17 Mar 2008 03:54:45 -0700 (PDT)
On Mar 13, 11:32 am, mast4as <mast...@xxxxxxxxx> wrote:
[snip]
The little app I need to write is a x-window to which a graphic[snip]
program sends an image. The graphic program renders a frame and send
it to the x-window in tiles (blocks of pixels). I ended up deciding to
implement that with a server (x-window) -client (graphic app) type of
model. The reason is that eventually several "instances" of the
graphic program can run on the computer at the same time and the
images that each "instance" works on, needs to be send to the same
window.
1/ on the client side (the graphic app), I'd like to start to the[snip]
server (the x-window) if it's not running yet. This yields 2 sub-
questions:
It sounds to me like you only intend to run the "server" and "clients"
on the same computer. Is this correct? If this is what you intend, why
not just have your application display an X window, and then start
multiple threads, each that render part of the graphic? Then you don't
have to deal with sockets at all.
Also note that unless you are are spending time waiting on hardware to
do something and you want to do some other processing in the mean
time, you won't gain any performance by starting more "clients" than
the number of cpu cores you have in your machine. One advantage of
doing it with sockets, like you say, is that you do have the
possibility of running the clients on other computers. But, again, if
your intention is only to do this on a single machine, you're better
off just doing it with a single process containing multiple threads.
Jason
.
- Follow-Ups:
- Re: advices on sockets
- From: jason.cipriani@xxxxxxxxx
- Re: advices on sockets
- References:
- advices on sockets
- From: mast4as
- advices on sockets
- Prev by Date: Re: pid_t data type
- Next by Date: Re: advices on sockets
- Previous by thread: Re: advices on sockets
- Next by thread: Re: advices on sockets
- Index(es):