AW: Using Threads? - Mailing list pgsql-hackers

From Zeugswetter Andreas SB
Subject AW: Using Threads?
Date
Msg-id 11C1E6749A55D411A9670001FA68796336816E@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
List pgsql-hackers
> > The cons side of processes model is not the startup time. It is about
> > kernel resource and context-switch cost. Processes consume much more
> > kernel resource than threads, and have a much higher cost for context
> > switch. The scalability of threads model is much better than that of
> > processes model.
> 
> My question here is how much do we really context switch.  We 
> do quite a
> bit of work for each query, and I don't see us giving up the CPU very
> often, as would be the case for a GUI where each thread does a little
> work and goes to sleep.

Every IO gives up the CPU ! In a threaded model the process could use up it's 
CPU timeslice for other clients.

The optimum would be a multi process multi threaded server. But this only starts to 
show an effect if there are a lot of clients (thousands).

Andreas


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: Using Threads?
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: Oracle-compatible lpad/rpad behavior