On Tuesday, 12 May 2015 at 10:58:08 UTC, Rikki Cattermole wrote:
On 12/05/2015 10:40 p.m., tcak wrote:
I am developing a web server - web application system, and it
is going
to be running on a small system that has 256MB memory at
maximum. Hence,
I tried to use every bit of memory without wasting, and used
align(1) on
a struct type. Because it is used as shared, and its internal
variables
are updated in time, core.atomic.atomicOp is being used. Until
today,
whenever I tried to update variables with atomicOp, running
thread was
basically returning from that point like nothing happened.
After long
debugging, I finally saw that thread has given AssertError
with a line
number. There wasn't any information about what was going on.
I went to
core.atomic file, and found out that (not on the given line
number),
variables should be properly aligned to use atomicOp.
Just out of interest, is said web server meant to be comparable
to e.g. Apache httpd?
Yes. Web server and application are running separately. Web
server is parsing request message, and by using host, determining
which web application to route the request. Web application gets
the request, does extra parsing like query, path, cookies, etc.
and sends response message back to web server, and it sends those
messages back to client.
I am using shared memory, and named pipe for these to be able to
increase performance as high as possible. Thus, it is relies on
Posix and my mostly my own library codes.