From: Brett v. de S. <bv...@as...> - 2010-03-18 00:41:13
|
>> >> Thanks. That (hash consing) is essentially what I am doing. >> The only twist is that I am saving the the lisp expressions to a >> file (along with a table of pointers) and, when I am running my >> server, I reconstruct the cons pointers as I read the expressions >> from the file. > >you are not describing everything. > >when is "when i am running my server"? when it starts up, or on each >request? > >in any case, your problem does not sound like one where hash consing >will be the complete answer. >from what you have revealed so far, you do not want to release the >resources. > Sorry for the vagueness. What I do is the following: I generate model solutions to the problems in Andes beforehand and save them in data files. These model solutions are represented mainly in terms of lisp expressions. When I am running my Andes server and a student starts solving a problem, I read in the model solutions from the appropriate data file. In this case, I need the model solutions to be stored efficiently in memory, since there will be several hundred students working simultaneously on different problems. Once the student is finished working on that problem, I no longer need that model solution and the data is freed for garbage collection. Obviously, if several students are working on the same problem, I could share some of the data, but I need to support the case where all students are working on different problems. Brett |