1. Phix : win32lib7

Hi Pete

As you know I'm converting win32lib 0.70.4 to work with Phix, as opposed to win32lib 0.60 (henceforth called win32lib7 and win32lib6).

I have had some success. So I have got advanc.exw to work, but have had to take out task_yield() (3 occurences) from win32lib.ew(7), as calling it gave this error

C:\euphoria\Phix\builtins\VM\pTask.e:610 in procedure task_yield() 
variable tasks has not been assigned a value 
    t = <novalue> 
... called from C:\euphoria\Phix\demo\win32lib7\win32lib.ew:24988 in procedure eventLoop() 
    pData = {} 
    temp = <novalue> 
    msg = 44667884 
    getRC = 1 
    hDlg = 3605828 
    inc = <novalue> 
    el = 1 
    lTock = 0 
... called from diag.e: symtab[1158] bad S_NTyp[3] 
C:\euphoria\Phix\demo\win32lib7\win32lib.ew:-1 in procedure WinMain() 
    id = 3 
    style = 0 
    lInitFocus = -1 
    lRtnId = <novalue> 
    lEventName = <novalue> 
    lInitView = <novalue> 
... called from C:\euphoria\Phix\demo\Win32Demo\Advanc.exw:105 
 
etc.etc..... 

looking through ptask, the reason tasks has not been assigned a value, is because a task has not been created, so I'm guessing that task_yield is a win32lib7 function. However, there is no win32lib(7) call to task_create(). My question is this - in Phix if a task has not been created, it looks like it will crash, but win32lib7 seems to want to yield tasks, even though it doesn't create them, so will commenting out win32libs task_yield cause a problem?

Cheers

Chris

new topic     » topic index » view message » categorize

2. Re: Phix : win32lib7

ChrisB said...

C:\euphoria\Phix\builtins\VM\pTask.e:610 in procedure task_yield()

so I'm guessing that task_yield is a win32lib7 function.

Not sure why you'd guess that. It's obviously a builtin in Phix. It's also an OE builtin: http://openeuphoria.org/docs/std_task.html#_2011_task_yield

ChrisB said...

However, there is no win32lib(7) call to task_create().

Sounds like a bug in Phix - if there are no tasks, then task_yield() should check that and do nothing (instead of crashing).

Though this formulation is odd - in OE there is always at least one task running, even if no other tasks are created - the main task that runs the main body of the code.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Phix : win32lib7

jimcbrown said...
ChrisB said...

C:\euphoria\Phix\builtins\VM\pTask.e:610 in procedure task_yield()

so I'm guessing that task_yield is a win32lib7 function.

Not sure why you'd guess that. It's obviously a builtin in Phix. It's also an OE builtin: http://openeuphoria.org/docs/std_task.html#_2011_task_yield

ChrisB said...

However, there is no win32lib(7) call to task_create().

Sounds like a bug in Phix - if there are no tasks, then task_yield() should check that and do nothing (instead of crashing).

Though this formulation is odd - in OE there is always at least one task running, even if no other tasks are created - the main task that runs the main body of the code.

Oh Jim, I'm going to be doing a lot of guessing in this project!

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

4. Re: Phix : win32lib7

ChrisB said...

I have had to take out task_yield() from win32lib.ew

Jim is spot on, it is a plain and simple bug in builtins\VM\pTask.e - hopefully adding the following to the top of task_yield() will fix it:

    if current_task=0 then return end if 

There should be no need to rebuild Phix after saving that change.
I also applied similar fixes for task_clock_start and task_list, let me know if you need them.

ChrisB said...

will commenting out win32libs task_yield cause a problem?

That would probably have been fine in the short term, for any app not invoking task_create.

Thanks for finding that,
Pete

new topic     » goto parent     » topic index » view message » categorize

5. Re: Phix : win32lib7

Yes, it Phixed it.

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: Phix : win32lib7

Hi

The Phix Win32lib7 project is now complete, barring any new bugs that arise, although all the Phix included win32lib demos and all the original win32lib demos now work.

Please let me know if any other bugs appear, I will be more than happy to update win32lib7.

Now on to the Phix : IDE 104 Phix edition project

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu