| Author |
Message |
|
| flodis |
Posted: Tue Oct 27, 2009 6:43 am |
|
|
|
User
Joined: 09 Jul 2008
Posts: 27
|
I am making a MUD-like game.
Content is created by recuiting developers from the player base which means I have to plan for a massive amount of developers.
Each developer should have their own home directory where they can create directory structured and erlang code. They should also have the ability to load their own code into the server.
I found out I can do this by:
Code:
{ok, Mod, Binary} = compile:file("dir1/test.erl", [binary]).
code:load_binary(Mod, Mod, Binary).
Mod will contain the atom 'dir1/test' and I can execute the module functions with:
The obvious problem with this that a new atom is generated for each file, which means after loaded just above one million files the node has reached is max allocated atoms.
My first thoughts on solving this problem is that I could somehow free old unused atom names, is there an undocumented BIF for this?
Suggestions towads other solutions would highly appreciated. |
|
|
| Back to top |
|
| uwiger |
Posted: Tue Oct 27, 2009 7:36 am |
|
|
|
User
Joined: 03 Jul 2006
Posts: 604
Location: Sweden
|
flodis wrote: Each developer should have their own home directory where they can create directory structured and erlang code. They should also have the ability to load their own code into the server.
There are of course severe security repercussions involved in doing this, unless you have a means of safe-compiling the code.
Perhaps you might find erlhive useful:
http://erlhive.sf.net
flodis wrote: The obvious problem with this that a new atom is generated for each file, which means after loaded just above one million files the node has reached is max allocated atoms.
My first thoughts on solving this problem is that I could somehow free old unused atom names, is there an undocumented BIF for this?
No. The only facility for controlling this is really to use list_to_existing_atom/1 and binary_to_existing_atom/1 whenever possible. The only way to clear out the atom table is to restart the node.
erlhive doesn't solve this either, but at least has the framework to address it... A nice little hobby project. [/url] |
_________________ http://www.erlang-consulting.com |
|
| Back to top |
|
| flodis |
Posted: Wed Oct 28, 2009 1:14 pm |
|
|
|
User
Joined: 09 Jul 2008
Posts: 27
|
Thanks for the tip. But is seems that the repository for erl erlhive does not work:
Code:
svn co https://erlhive.svn.sourceforge.net/svnroot/erlhive erlhive
svn: Unrecognized URL scheme for 'https://erlhive.svn.sourceforge.net/svnroot/erlhive'
|
|
|
| Back to top |
|
| uwiger |
Posted: Wed Oct 28, 2009 1:29 pm |
|
|
|
User
Joined: 03 Jul 2006
Posts: 604
Location: Sweden
|
flodis wrote: Thanks for the tip. But is seems that the repository for erl erlhive does not work:
Code:
svn co https://erlhive.svn.sourceforge.net/svnroot/erlhive erlhive
svn: Unrecognized URL scheme for 'https://erlhive.svn.sourceforge.net/svnroot/erlhive'
Strange - it works for me. You could perhaps try replacing https with http? |
_________________ http://www.erlang-consulting.com |
|
| Back to top |
|
| uwiger |
Posted: Wed Oct 28, 2009 1:42 pm |
|
|
|
User
Joined: 03 Jul 2006
Posts: 604
Location: Sweden
|
Fair warning: Erlhive does not work with OTP R13B. The problem (at least the first, obvious one) lies with the erlhive_ram_file_io_server module, which doesn't understand the new io request messages (changed in R13 due to the introduction of Unicode support).
Fixing this has low priority, unless some eager users show up. Others who might like to give it a go, can contact me for commit access to the repository. |
_________________ http://www.erlang-consulting.com |
|
| Back to top |
|
| flodis |
Posted: Wed Oct 28, 2009 5:13 pm |
|
|
|
User
Joined: 09 Jul 2008
Posts: 27
|
uwiger wrote: flodis wrote: Thanks for the tip. But is seems that the repository for erl erlhive does not work:
Code:
svn co https://erlhive.svn.sourceforge.net/svnroot/erlhive erlhive
svn: Unrecognized URL scheme for 'https://erlhive.svn.sourceforge.net/svnroot/erlhive'
Strange - it works for me. You could perhaps try replacing https with http?
It worked for me at home, must have some strange svn-installation in my box at work. |
|
|
| Back to top |
|
|
|