Re: Needs Suggestion

Поиск
Список
Период
Сортировка
От subham@cse.iitb.ac.in
Тема Re: Needs Suggestion
Дата
Msg-id 7d33e80e5c35f1e61d8b13a2c947a7cd.squirrel@www.cse.iitb.ac.in
обсуждение исходный текст
Ответ на Re: Needs Suggestion  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Needs Suggestion  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers

Actually, I used palloc() to set the stack base address.
And I am trying to create only a single thread, then also it is causing
problem.
Actually, I created all the data-structures using palloc(), then I am
passing these to the child thread. Even if I make these variables global
then also it is not working.
But if I don't set its stack address then it is working. But I need to do
that because when my thread body is big then it is causing stack fault.
So if I cannot set its stack address then Can I increase the stack depth
limit to a large value ?

-- 

Thank You,
Subham Roy.

> On 22/09/10 11:14, subham@cse.iitb.ac.in wrote:
>>
>> How can I increase the stack depth limit ? Is it only by modifying the
>> postgres.conf file, but there I cannot increase the stack depth beyond 4
>> MB.
>>
>> Actually, my problem is that, when I set the stack base address of the
>> child thread using the POSIX library function "pthread_setstackaddr()",
>> I
>> am unable to access the memory contents of its parent. The
>> data-structures
>> in the parent are either getting destroyed or unaccessible when moving
>> to
>> the context of the child thread.
>
> It is not a good idea to use threads in server code. PostgreSQL server
> code is not thread-safe, things will break.
>
> Assuming that you're not actually doing that but using threads in the
> client instead, max_stack_depth should have no effect on you as it only
> affects the server.
>
> But you really should find another way to communicate between threads.
> Stacks should be treated as thread-private. Use malloc() or something
> and global variables.
>
> --
>    Heikki Linnakangas
>    EnterpriseDB   http://www.enterprisedb.com
>






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bernd Helmle
Дата:
Сообщение: Re: WIP: Triggers on VIEWs
Следующее
От: subham@cse.iitb.ac.in
Дата:
Сообщение: Re: Needs Suggestion