Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26aa69a

Browse files
committed
Add threaded mention email.
1 parent746d7e9 commit26aa69a

File tree

1 file changed

+232
-0
lines changed

1 file changed

+232
-0
lines changed

‎doc/TODO.detail/thread

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
From mscott@sacadia.com Wed Nov 15 14:50:19 2000
2+
Received: from goldengate.kojoworldwide.com. ([216.133.4.130])
3+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id OAA11583
4+
for <pgman@candle.pha.pa.us>; Wed, 15 Nov 2000 14:50:13 -0500 (EST)
5+
Received: from localhost (localhost [127.0.0.1])
6+
by goldengate.kojoworldwide.com. (8.9.1b+Sun/8.9.2) with ESMTP id LAA09998;
7+
Wed, 15 Nov 2000 11:35:33 -0800 (PST)
8+
Date: Wed, 15 Nov 2000 11:35:33 -0800 (PST)
9+
From: Myron Scott <mscott@sacadia.com>
10+
X-Sender: mscott@goldengate.kojoworldwide.com.
11+
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
12+
Bruce Momjian <pgman@candle.pha.pa.us>, Tom Lane <tgl@sss.pgh.pa.us>
13+
Subject: Please help with some advice
14+
Message-ID: <Pine.GSO.4.10.10011151053260.9940-100000@goldengate.kojoworldwide.com.>
15+
MIME-Version: 1.0
16+
Content-Type: TEXT/PLAIN; charset=US-ASCII
17+
Status: ORr
18+
19+
Dear Sirs,
20+
21+
I have been lurking on the PostgreSQL hackers list for about 3 months now
22+
and your names comes up more than any with helpful info about the project
23+
so I was hoping you could help me.
24+
25+
Let me cut to the chase. I have been experimenting with 7.0.2 source to
26+
see if I could create a mutlti-threaded version of the backend so
27+
I could link directly from java ( I have a fe<->be protocol that I use for
28+
my apps). Needless to say I got into much more than I bargained for. I
29+
now have a version that works and it has some nice benefits that are very
30+
helpful to a project that I am working on. What I gained was
31+
32+
prepared statements outside of spi
33+
batched commits (fsync)
34+
one connection per thread
35+
multiple threads per process
36+
multiple processes per installation
37+
38+
I never really intended for anyone else to see the work so I drifted
39+
pretty far from the original code. I also ended up using Solaris threads
40+
rather than pthreads, I did my own implementation of the bufmgr.c and
41+
gram.y, and used Solaris implementation of mutex in place of S_LOCK and
42+
TAS. I grabbed all global variables and put them in an environment
43+
variable that is thread local. I also did some really stupid
44+
things like making TransactionId uint64 and making all my inserts use the
45+
same oid.
46+
47+
My question is this. I would like to get some critical feedback and
48+
suggestions about the work from others. What is the best way to go about
49+
this? I thought about trying to create a project on greatbridge.org
50+
but I am rather new to open source and the code needs commented properly
51+
and cleaned up before too many try and look at it.
52+
53+
Any suggestions would be greatly appreciated.
54+
55+
56+
Thanks in advance,
57+
58+
Myron Scott
59+
60+
61+
62+
From mscott@sacadia.com Thu Nov 16 17:19:45 2000
63+
Received: from goldengate.kojoworldwide.com. ([216.133.4.130])
64+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id RAA04315
65+
for <pgman@candle.pha.pa.us>; Thu, 16 Nov 2000 17:19:43 -0500 (EST)
66+
Received: from localhost (localhost [127.0.0.1])
67+
by goldengate.kojoworldwide.com. (8.9.1b+Sun/8.9.2) with ESMTP id OAA11449;
68+
Thu, 16 Nov 2000 14:05:15 -0800 (PST)
69+
Date: Thu, 16 Nov 2000 14:05:15 -0800 (PST)
70+
From: Myron Scott <mscott@sacadia.com>
71+
X-Sender: mscott@goldengate.kojoworldwide.com.
72+
To: Bruce Momjian <pgman@candle.pha.pa.us>
73+
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, Tom Lane <tgl@sss.pgh.pa.us>
74+
Subject: Re: Please help with some advice
75+
In-Reply-To: <200011160533.AAA27886@candle.pha.pa.us>
76+
Message-ID: <Pine.GSO.4.10.10011161401570.11441-100000@goldengate.kojoworldwide.com.>
77+
MIME-Version: 1.0
78+
Content-Type: TEXT/PLAIN; charset=US-ASCII
79+
Status: OR
80+
81+
Bruce Momjian wrote:
82+
83+
>I am curious how you isolated each thread. It seems we pretty much
84+
>assume all our memory is controlled by a single query in the process.
85+
86+
87+
I moved all global variables to a thread global variable which is accessed
88+
by the method GetEnv(). Which looks like this
89+
90+
Env* GetEnv(void) {
91+
Env* env;
92+
thr_getspecific(*envkey,(void*)&env);
93+
return env;
94+
}
95+
96+
The Env struct includes the CurrentMemoryContext, TopMemoryContext,
97+
PortalHeapMemory for each instance of a connection (one thread per
98+
connection). So, for example,
99+
EndPortalAllocMode uses GetEnv()->CurrentMemoryContext
100+
101+
void
102+
EndPortalAllocMode()
103+
{
104+
PortalHeapMemory context;
105+
106+
AssertState(PortalManagerEnabled);
107+
AssertState(IsA(GetEnv()->CurrentMemoryContext,
108+
PortalHeapMemory));
109+
110+
context = (PortalHeapMemory) GetEnv()->CurrentMemoryContext;
111+
AssertState(PointerIsValid(context->block));/* XXX
112+
Trap(...) */
113+
114+
/* free current mode */
115+
AllocSetReset(&HEAPMEMBLOCK(context)->setData);
116+
MemoryContextFree((MemoryContext)
117+
PortalHeapMemoryGetVariableMemory(context),
118+
context->block);
119+
120+
/* restore previous mode */
121+
context->block = FixedStackPop(&context->stackData);
122+
}
123+
124+
125+
126+
127+
From vmikheev@SECTORBASE.COM Thu Nov 16 17:23:22 2000
128+
Received: from sectorbase2.sectorbase.com ([208.48.122.131])
129+
by candle.pha.pa.us (8.9.0/8.9.0) with SMTP id RAA04562
130+
for <pgman@candle.pha.pa.us>; Thu, 16 Nov 2000 17:23:21 -0500 (EST)
131+
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2650.21)
132+
id <V8XQB5RW>; Thu, 16 Nov 2000 14:05:24 -0800
133+
Message-ID: <8F4C99C66D04D4118F580090272A7A234D318D@sectorbase1.sectorbase.com>
134+
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
135+
To: "'Myron Scott'" <mscott@sacadia.com>,
136+
Bruce Momjian
137+
<pgman@candle.pha.pa.us>
138+
Cc: Tom Lane <tgl@sss.pgh.pa.us>
139+
Subject: RE: Please help with some advice
140+
Date: Thu, 16 Nov 2000 14:09:30 -0800
141+
MIME-Version: 1.0
142+
X-Mailer: Internet Mail Service (5.5.2650.21)
143+
Content-Type: text/plain;
144+
charset="iso-8859-1"
145+
Status: ORr
146+
147+
I think the question do we want to make backend multy-threaded
148+
should be discussed in hackers.
149+
150+
Vadim
151+
152+
> -----Original Message-----
153+
> From: Myron Scott [mailto:mscott@sacadia.com]
154+
> Sent: Thursday, November 16, 2000 2:05 PM
155+
> To: Bruce Momjian
156+
> Cc: Mikheev, Vadim; Tom Lane
157+
> Subject: Re: Please help with some advice
158+
>
159+
>
160+
> Bruce Momjian wrote:
161+
>
162+
> >I am curious how you isolated each thread. It seems we pretty much
163+
> >assume all our memory is controlled by a single query in the process.
164+
>
165+
>
166+
>
167+
> I moved all global variables to a thread global variable
168+
> which is accessed
169+
> by the method GetEnv(). Which looks like this
170+
>
171+
> Env* GetEnv(void) {
172+
> Env* env;
173+
> thr_getspecific(*envkey,(void*)&env);
174+
> return env;
175+
> }
176+
>
177+
> The Env struct includes the CurrentMemoryContext, TopMemoryContext,
178+
> PortalHeapMemory for each instance of a connection (one thread per
179+
> connection). So, for example,
180+
> EndPortalAllocMode uses GetEnv()->CurrentMemoryContext
181+
>
182+
> void
183+
> EndPortalAllocMode()
184+
> {
185+
> PortalHeapMemory context;
186+
>
187+
> AssertState(PortalManagerEnabled);
188+
> AssertState(IsA(GetEnv()->CurrentMemoryContext,
189+
> PortalHeapMemory));
190+
>
191+
> context = (PortalHeapMemory) GetEnv()->CurrentMemoryContext;
192+
> AssertState(PointerIsValid(context->block));/* XXX
193+
> Trap(...) */
194+
>
195+
> /* free current mode */
196+
> AllocSetReset(&HEAPMEMBLOCK(context)->setData);
197+
> MemoryContextFree((MemoryContext)
198+
> PortalHeapMemoryGetVariableMemory(context),
199+
> context->block);
200+
>
201+
> /* restore previous mode */
202+
> context->block = FixedStackPop(&context->stackData);
203+
> }
204+
>
205+
>
206+
>
207+
208+
From mscott@sacadia.com Thu Nov 16 22:16:38 2000
209+
Received: from goldengate.kojoworldwide.com. ([216.133.4.130])
210+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA14638
211+
for <pgman@candle.pha.pa.us>; Thu, 16 Nov 2000 22:16:36 -0500 (EST)
212+
Received: from localhost (localhost [127.0.0.1])
213+
by goldengate.kojoworldwide.com. (8.9.1b+Sun/8.9.2) with ESMTP id TAA11874;
214+
Thu, 16 Nov 2000 19:04:48 -0800 (PST)
215+
Date: Thu, 16 Nov 2000 19:04:48 -0800 (PST)
216+
From: Myron Scott <mscott@sacadia.com>
217+
X-Sender: mscott@goldengate.kojoworldwide.com.
218+
To: Bruce Momjian <pgman@candle.pha.pa.us>
219+
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, Tom Lane <tgl@sss.pgh.pa.us>
220+
Subject: Re: Please help with some advice
221+
In-Reply-To: <200011170156.UAA11438@candle.pha.pa.us>
222+
Message-ID: <Pine.GSO.4.10.10011161904140.11870-100000@goldengate.kojoworldwide.com.>
223+
MIME-Version: 1.0
224+
Content-Type: TEXT/PLAIN; charset=US-ASCII
225+
Status: ORr
226+
227+
Thanks very much, I will post to hackers.
228+
229+
Myron
230+
231+
232+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp