Just inform people here that I ported redis db
to Windows using Mingw from ruby devkit.
Redis is fairly new NoSQL Key-Value datastore.
More about it on http://redis.io
If you have ruby DevKit you can clone my repository
and build redis using make from devkit command line.
For running tests you will need Tcl that is not inlcluded
in Devkit installation, but I installed it from source.
Source code
http://github.com/dmajkic/redis
Prebuild binaries (Win32)
http://github.com/dmajkic/redis/downloads
--
Regards
Dusan Majkic
Very nice! Will have to give it a try.
I'm assuming you built it with DevKit 4.5.0? Have you had a chance to try building with the "edge" DevKit 4.5.1 that can be create from running "rake devkit sfx=1" from the http://github.com/oneclick/rubyinstaller/tree/dk32-451 branch?
If you're really feeling adventurous and want to burn some time, you could try build an edge DevKit based upon LLVM-GCC v2.8 and see how it works by running "rake devkit sfx=1 dkver=llvm-32-2.8" from the same dk32-451 branch. Of course you'd need to tell Redis's configure/make that CC=llvm-gcc, CXX=llvm-g++, and maybe CPP=llvm-cpp. And then watch out for any calls to dllwrap (needs --driver-name=llvm-gcc) and windres (needs --preprocessor="llvm-gcc -E -xc") and probably a few other things ;)
Thanks,
Jon
I checked where redis is using usleep, and it is used in vm.c
in three places: once to usleep(1), which is in Windows
pronounced as Sleep(0) (give time slice to thread).
And in other two places it waits 10000 and 100000 which can
be directly translated to Sleep() from windows api.
That is good news: No fine-grain picosecod timer is actually
needed. This two lines should work for both llvm and mingw:
#undef usleep
#define usleep(x) (x == 1) ? Sleep(0) : Sleep((int)((x)/1000))
Basicly it translates usleep(1) -> Sleep(0) and others
usleep(x) -> Sleep(x/1000).
> However, llvm version fails couple of test :(, too bad....
Will check that also.
I Installed llvm devkit, and there are a few more warnings.
Stay tuned.
Could you check if there are log files in tests/tmp/server.XXXX
Check stdout or stderr files for error messages.
If you have process id from hanged server, that can help also.
Every line in stdout file starts with it. Like: [6004] 16 Oct 20:..
2010/10/15 Dušan Majkić <dma...@gmail.com>:
> Hi.
>
> Just inform people here that I ported redis db
> to Windows using Mingw from ruby devkit.
>
Thank you. this is an impressive amount of work that I wanted to
tackle long ago but neither my skills or time allowed me to.
I hope this work can be integrated in antirez's repository so other
benefits from it.
Something I noticed from your announcement in redis group is that
commands that depend on fork() are executed in-process.
I was thinking perhaps a separate thread can be spawned so calls to
BGSAVE and BGREWRITEAOF do not interfere with redis accepting
requests.
Again, thank you. Impressive work you have done on this.
I was wondering if you're interested in help Brian Ford on port
Rubinius to Windows? I wish I can be involved more but work has been
pretty much climbing up.
Anyhow, thank you!
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
Fork() itself is not so much important here. Redis uses nice side effect
of fork and that is that modern unix/linux will provide memory snapshot
virtually for free, in no time. Copy-On-Write protected.
That means that both processes work with same memory, but
when parent writes something, kernel will copy that mem block so that
child process is not affected in any way.
In fact, these forked calls are transaction replacement.
In SQL DB kind of thinking.
You can CreateProcess (or Thread) in Windows, but you can't give
Copy-On-Write protected access to memory to child process.
If you want Copy-On-Write you must use CreateFileMapping.
Cygwin fork() will copy all memory from parent to child.
Not efficent in case of redis, since BGSAVE will than copy mem+copy
to disk. Slow, double work, with great risk from "Out of memory" error.
> I was thinking perhaps a separate thread can be spawned so calls to
> BGSAVE and BGREWRITEAOF do not interfere with redis accepting
> requests.
Yup. Same thinking here.
Just need to find a way to protect objects beings saved from altering
or deletion from main thread. I needed redis for in-memory only
helper storage, so this solution did the job.
> I was wondering if you're interested in help Brian Ford on port
> Rubinius to Windows? I wish I can be involved more but work
> has been pretty much climbing up.
I am not that much skilled in cpp to be of any usable help.
Will take a look. No promises.
I think you both are doing very cool things here with Redis, DevKit, and the RubyInstaller.
When you two get things working and are both happy with the results, would you mind linking a tutorial blog to our project wiki at http://github.com/oneclick/rubyinstaller/wiki/Tutorials
Thank you,
Jon