Arc Forumnew | comments | leaders | submit | joebo's commentslogin
2 points by joebo 5298 days ago | link | parent | on: wart on win32

Hi akkartik - Thank you! Your code helped me greatly. there's an issue though with it. The spawn actually needs to happen after the socket is connected. see this for an example:

https://gist.github.com/824730

I tried this on win32 and it works fine. You can see the effect of the thread if you put a (sleep 5) before the dispatch. Multiple requests can connect and then each completes 5 seconds later.

Note: To get threads working on win32, I used this build of SBCL http://www.siftsoft.com/inprogress/sbcl-1.0.44.211.msi from this thread: http://dmitry-vk.livejournal.com/35946.html

Note: I know there's some rookie stuff in the arc/sbcl code of mine. I could replace the lets with withs but am still learning.

-----

1 point by akkartik 5298 days ago | link

So the default windows build doesn't have fork or threads?

Yeah I added the per-request spawn a couple of hours after the initial naive version. Have you pulled recently?

https://github.com/akkartik/wart/commit/77c353a1a86c99761dd1... [1]

The spawn doesn't happen quite where it does in your version, so I think the master ends up doing a little more work per request. Let me know if that has implications; I think you know more about this.

[1] Buggy version, but next commit was good. Just do a git pull.

-----

2 points by joebo 5299 days ago | link | parent | on: wart on win32

Thanks for the super quick reply. I just came to the same conclusion and came back to reply.

I spent a few minutes in sb-posix\interface.lisp in SBCL and found that fork was defined under:

#-win32

Which apparently means it's not part of the win32 version. Bummer...

I'll post if I come up with a valid workaround.

Thanks again! (by the way, the wart's code is a joy to read and makes it simple to troubleshoot)

-----

1 point by akkartik 5299 days ago | link

That is awesome to hear. Arc is a readable language; making the implementation readable is my only goal.

Feel free to ping me by email as well (address in profile).

-----

3 points by evanrmurphy 5299 days ago | link

I'm using wart as a way to help ease me into Common Lisp. I've had difficulty before reading CL code because the names of common operators are so different from arc's (the lisp dialect I know best). wart helps by putting it in familiar terms.

-----

1 point by akkartik 5299 days ago | link

Thanks! https://github.com/akkartik/wart/commit/8b8bcdaa421057564a34... :)

-----