Abstract: The aim of this project is to finish the experimental multithreading interface in Clisp by implementing a lock free hash table that is a drop in replacement of current implementation. This will guarantee a "safe execution" such that clisp does not crash/segfault when manipulated with multiple threads.
Name: Shashank Srivastav
Project: GNU- CLISP
The aim of this project is to finish the experimental multithreading interface in Clisp by implementing a lock free hash table that is drop in replacement of the current implementation.
I have read about the internal workings of Clisp. And have covered almost 2/3rd of the 'src/hashtabl.d' file which contains the pre-processed C code used for implementing hash tables and will be used for creating the lock-free version.
The experimental multithreading feature will primarily be completed by making lock-free hash tables, since Hash tables are the known standard datatype that causes segfaults when manipulated from multiple threads. Hence upon completing the project a major section of the CLISP will be completely usable and will not result in any breakdowns when CLISP is built with threads on various platforms.
Thus completion of this project is essential to both GNU CLISP and fellow users.
Staring on April 20, when Google announces the accepted students, the whole available time of GSoC is about 16 weeks. Accordingly, my planned schedule is:
Week 1 - Week 3: Get to know the community; discuss the project details with my mentor. Study the code and spec.
Week 3 - Week 4: Read from the ClosureCL's (lock-free approach) and understand the working of a lock-free hash-table that prevents segfaults.
Week 4 - Week 6: Start to develop a prototype of thread-safe hash table(a lock-free implementation).
Week 6 - Week 9: Implement a thread-safe hash table;
Week 9 - Week 12: Work on implementation for different platforms: Posix_Threads, Win32 threads. (milestone for mid-term evaluation)
Week 12 - Week 14: Work on integrating weak hash relations with Garbage Collection. Achieve thread synchronization by using mutexes and try to make objects immutable.
Week 14 - Week 15: Write some tests for the threaded code. Observe for any occurrence of segfaults. Multithreaded interface finished; gather some statistics by doing preliminary experiments
Week 15 - Week 16: Tidy up any loose ends; ensure the code is integrated. And updated in the mercurial repository on sourceforge. (goal for final evaluation)
Note that these are approximated schedule. Please allow minor adjustments according to the actual project status. I'm certainly willing to make more efforts if the project is behind schedule.
I will be studying at 3/4 load until the mid-June due to college exams. I will then be free to work on this full-time from June-end until mid-August.
The plan is to develop a working prototype of lock-free hash table implementation by the mid-term evaluation, which will eventually be used to construct and finalize the multithreaded interface. And also finish the work to support different platforms: Unix-based OSes and Microsoft Windows. This will be a good point for the mid-term evaluation, Since the prototype hash table can be used to create the drop in replacement for current implementation. So it's already like a half-working version, simply lacking some additional work.
After the mid-term evaluation, the work has to speed up and the thread-safe hash table should be completed within 2 weeks with GC integration. Such that, the last 3-4 weeks can be spent to observe any occurrence of crash or segfault and write the relative documentation.
The mentor can keep track of the code progress by viewing the code/commit history on a new repository that I can create on Github (depending upon the permission to do so) and I will keep updating the available code there. Or we can devise any other suggested method to track my progress with the mentor . Also I will be posting regular updates on my blog (http://shashankgroovy.github.io/) too.
For asynchronous communication, we can use the email and the clisp-devel mailing list everyday and also for asking general questions related to the project.
For real-time interaction, I am always online on gtalk or we can also contact on the IRC network.
- Why did this project appeal to me?
I have been studying Common Lisp lately and I use Clisp everyday to execute my programs. And after finding out that GNU Clisp is a participating project in Gsoc'14, the only reasonable thing as a programmer that occurred to me would be to extend and contribute to the Free software I am using.
- How will I benefit from it?
At a personal level I have just begun to program in Common Lisp and this project delves upon extending the Clisp such that it does not crash or give segmentation fault while doing multithread programming, which I might/shall use as I dig deeper in Lisp. But more importantly I will learn about contributing to Free Software and gain a great-learning experience.
- Why am I particularly suited to work on this?
I have a good knowledge about C and know the basic workaround with hash tables and a brief insight on threads. I also am learning about hash tables and multithreading in 2 of my courses this semester in college and I believe this is a perfect way to enhance my skill-set in this domain.
I am learning Lisp and I can't pay a better tribute to Lisp by contributing to Clisp and would love and I am more than willing to do the necessary background work as it sounds fun.
- What will I do once the project is finished?
I plan to look into other issues and experimental features of CLISP and become an active maintainer and contributor to CLISP and also GNU in general. I realize the beauty of free software and the need for active developers in them, hence I will certainly start contributing to other GNU projects too.
- Have I worked on 'Free Software' before?
No. This will be my first contribution to Free Software. However, I have worked on python based open-source project before.
- Of the skills that I will need to complete the project, which do I already have?
The project requires that most the work be done in C. I have a good knowledge in programming with C and I know how to use gcc and gdb tools. The project involves multithread programming, though I am inexperienced with multithreading in C but I have done it in Java.
- What will I need to learn?
Multhithread and lock-free programming are two major concepts I'd need to learn. I can add these skills to my repertoire and learn to work with them during the gap and before the community bonding period begins. Also, I can strengthen my proficiency in C during the same time.