Re: Strange error (Socket command option unknown)
От | Doug McNaught |
---|---|
Тема | Re: Strange error (Socket command option unknown) |
Дата | |
Msg-id | m3adgnvxi4.fsf@varsoon.wireboard.com обсуждение исходный текст |
Ответ на | Strange error (Socket command option unknown) (Carlos Moreno <moreno@mochima.com>) |
Список | pgsql-general |
Carlos Moreno <moreno@mochima.com> writes: > I wonder if the fact that my app. is multi-threaded > (logging to database is something that has kind of > low-priority, and I don't want it to interfere with the > "main loop" of my app. -- the main loop is basically > the communications loop, which is critical for the > responsiveness of my server to the multiple clients). > > So, I wonder if I (or postgres??) is doing something > wrong with the multiple requests?? There are only > two threads that make any use of the database: > one that logs to db (i.e., exclusively insert, update, > and delete commands), and one to process the > login authentications (users' names and passwords > are stored in the database, along with related > information that has to be retrieved at login-time). If you're using the database from two threads, you should either be using one DB connection per thread, or protecting the single DB connection with a mutex lock for the duration of each query. One connection per thread is probably simplest. > So, is it possible that these two threads are "stepping > on each other's tails"? Quite possible, unless you're taking steps to prevent it. Sharing a single connection between independent threads with no locking is probably not going to work. -Doug
В списке pgsql-general по дате отправления: