Browsing this Thread:
1 Anonymous Users
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
866
![]() |
I tried the above code but it didn't quite solve problem. One of the arguments of LockMutex is still NULL, it could be ThreadBase too.
One thing I noticed is that you don't use pthread_join/WaitThread in your code. Instead you do busy loops until the given thread sets its state. I'm mentioning this, because one of the functions which overflows the stack is wait_thread_running(). edit: LockMutex fails in exe_elist(), because cclist_mutex is not itialized for AROS in main.c, hence the NULL pointer. edit #2: Ignore my previous post about the stack increasing wrapper, it's unnecessary. Initializing cclist_mutex solves the problem. Here are the two thread-waiting functions without the busy loop:
void wait_thread_running (S4 threadnum)
Replacing WaitThread with pthread_join would work on other platforms. Checking (pthreads[i].state == PTHREAD_RUNNING) isn't necessary anymore, since these thread waiting functions instantly return on terminated threads.
Posted on: 1/7 5:39
Edited by BSzili on 2013/1/7 6:03:13
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
Joined:
2010/1/1 6:14 Group:
Member Posts:
28
![]() |
Thanks for your help!
Now I found out what the error for not running the sort-test program was: I just messed up the "bytecode" while running the program in the VM. So the new code for the VM pointer instruction works now really. I compiled a version for Aros with my new code: it runs now the sort-test program without errors. I will add your code tomorrow into my actual version. Well here are my nano VM version 3.0.27 binaries attached.
Posted on: 1/7 12:17
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
866
![]() |
Great!
Have you added the socket stuff too? I'd like to try the nano web server on AROS.
Posted on: 1/8 0:23
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
Joined:
2010/1/1 6:14 Group:
Member Posts:
28
![]() |
I didn't touch the wait_thread_running () code:
It waits till the new thread is running. So it's not a wait for the thread end. And I didn't check the socket stuff. I have still to do this. I don't know if it works. The new source code is on my homepage. (www.jay-t.de).
Posted on: 1/8 10:32
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
866
![]() |
Is there a difference between waiting while the thread is running, and waiting for the thread to exit?
Posted on: 1/8 11:46
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
Joined:
2010/1/1 6:14 Group:
Member Posts:
28
![]() |
It's waiting till the thread is started (was created).
It's the thread_sync function in the examples. This is for synchronizing threads. The next step would be sendig data to the thread: with threadpush (). It should be a hello_thread.nc demo in the base archive on my homepage. I tried the webserver program: it exits with an error message: socket error: 2. What is that errorcode saying?
Posted on: 1/9 5:01
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
866
![]() |
Oops, then I misunderstood the purpose of the function
The error number says nothing to me, you should use strerror(). Have you applied all the bsdsocket-related changes?edit: Also make sure that to open bsdsocket.library in the same thread where you do the socket operations, because you can't share socket descriptors between threads. Technically it's possible to pass sds between threads, but it requires some extra code, and generally not worth the hassle if you can move all the socket manipulation into one thread.
Posted on: 1/9 7:20
Edited by BSzili on 2013/1/9 8:19:35
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
Joined:
2010/1/1 6:14 Group:
Member Posts:
28
![]() |
I just putted SocketBase into the pthreads structure:
And the threadnum is used by the socket open calls (server / client). So the init_arossock is called when pthreads[].socket_lib_open is false. I don't know if this is a good idea. Is this "legal" to do? But now I get a illegal instruction error while running the webserver program. I had to put a struct Library *SocketBase = NULL; into the VM main_d.h or it couldn't be compiled cause of the declaration in the aros includes.
Posted on: 1/10 13:04
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
866
![]() |
You are on the right path, but the implementation is not quite there. Every bsdsocket.library call takes SocketBase as an argument, and since you declared a global NULL SocketBase socket functions will fail. To solve the problem, you can include this header instead of proto/bsdsocket.h, and use SocketBase as normal, which will become the taks's user defined field. Please note that you have to do call init_arossock() in the right thread, preferably in a wrapper around exec_list, and don't declare a global SocketBase variable.
Posted on: 1/10 13:51
|
|
Transfer
|
||
Re: Nano VM - testers/developers wanted |
||
|---|---|---|
Joined:
2010/1/1 6:14 Group:
Member Posts:
28
![]() |
I did update my sourcecodes: the last version can be downloaded via subversion on sourceforge (3.0.29-4):
some bugfixes to the compiler, and other AROS changes on the code. You can take a look at it, if the socket stuff is done right. IMHO it still doesn't work right. Maybe I didn't made it right. I tested it and I still got error messages.
Posted on: 1/26 11:29
|
|
Transfer
|
||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.


Transfer
nano-aros.tar.gz
Have you added the socket stuff too? I'd like to try the nano web server on AROS.







