1. Multitasking unit test
- Posted by mattlewis (admin) Oct 09, 2009
- 1237 views
One of the gaps in our unit testing for v4 is for multitasking. Does anyone have any ideas for writing one? Preferably that doesn't require network access.
Matt
2. Re: Multitasking unit test
- Posted by euphoric (admin) Oct 09, 2009
- 1236 views
One of the gaps in our unit testing for v4 is for multitasking. Does anyone have any ideas for writing one? Preferably that doesn't require network access.
What are some of the requirements of such a test? My initial thought was build a directory tree, starting with the root. For each directory encountered, start a new task to get its files. You should end up with a ton of tasks, and even though you wouldn't normally do it this way, I think it would test the task system.
3. Re: Multitasking unit test
- Posted by jeremy (admin) Oct 09, 2009
- 1181 views
What are some of the requirements of such a test? My initial thought was build a directory tree, starting with the root. For each directory encountered, start a new task to get its files. You should end up with a ton of tasks, and even though you wouldn't normally do it this way, I think it would test the task system.
It needs to have a concrete testable result.
Jeremy
4. Re: Multitasking unit test
- Posted by mattlewis (admin) Oct 09, 2009
- 1205 views
What are some of the requirements of such a test? My initial thought was build a directory tree, starting with the root. For each directory encountered, start a new task to get its files. You should end up with a ton of tasks, and even though you wouldn't normally do it this way, I think it would test the task system.
Ideally, something deterministic. Maybe build some data, sleep, etc. But I'm open to suggestions. If I knew, I'd write it myself.
I think I've got tasks working again for recent linux distros. It still needs testing on other unix-like platforms (I think there may be some linker issues). But I've only had demo/news.ex to test with. One thing it doesn't do is suspend or delete tasks, possibly reusing the same task slots, etc. The new task backend for translated tasks is very different, relying on Windows Fibers and POSIX threads (pthreads) for other platforms.
Basically, demo/news.ex is a decent test platform to show that we can create and switch between tasks, but it definitely doesn't cover all of the things that tasks can do.
Matt
5. Re: Multitasking unit test
- Posted by euphoric (admin) Oct 09, 2009
- 1215 views
Ideally, something deterministic.
Oh yeah. Duh.
Well, you could do a dir() list and a task-derived list and compare. Yay! Go me!
It still needs testing on other unix-like platforms...
Like FreeBSD? I'll get a repo set up on mine tonight and get Euphoria downloaded. I'll need help with what to type to test. Maybe you could throw together a simple batch/script for me.
6. Re: Multitasking unit test
- Posted by mattlewis (admin) Oct 09, 2009
- 1225 views
It still needs testing on other unix-like platforms...
Like FreeBSD? I'll get a repo set up on mine tonight and get Euphoria downloaded. I'll need help with what to type to test. Maybe you could throw together a simple batch/script for me.
Yes, exactly. I think the other platforms are OSX and OpenSolaris. I'm not sure which others have been ported (Jeremy's been doing a lot of that work). Basically, here's what you should do (assuming that you built the binaries in the default, build subdir off of the source dirstart from there):
$ mkdir news $ cd news $ ../euc -makefile-full -debug -lib ../eu.a ../../../demo/news
This will also create news.mak, which you'll need to edit. The reason for this is that euphoria.h has changed, and you'll need to make sure that the local version is used. So change the -I flag in the compiler flags section of the makefile to point to the version from the repository. It should be something like: /home/euphoric/task_svn/ or wherever you've checked out the svn repository. Then:
$ make -f news.mak or possibly: $ gmake -f news.mak ...because it's probably outputting a GNU makefile, not a BSD makefile
...and you should be able to test it.
Matt
7. Re: Multitasking unit test
- Posted by raseu Oct 10, 2009
- 1204 views
i'd like to test this version out
where can i get a download
8. Re: Multitasking unit test
- Posted by mattlewis (admin) Oct 10, 2009
- 1197 views
i'd like to test this version out
where can i get a download
Right now it's only available via svn:
https://rapideuphoria.svn.sf.net/svnroot/rapideuphoria/branches/task_rewrite
You can get a gzipped tarball of the code here:
http://rapideuphoria.svn.sourceforge.net/viewvc/rapideuphoria/branches/task_rewrite.tar.gz?view=tar
Matt
9. Re: Multitasking unit test
- Posted by raseu Oct 10, 2009
- 1174 views
- Last edited Oct 11, 2009
thanks