16 April 2022, 12:17 | #1 |
Not a Rebel anymore
Join Date: Apr 2005
Location: UK
Age: 51
Posts: 497
|
Native code (eg bsdsocket.library) and multi-tasking
A quick question for Toni. How does executing native x86 code (such as the emulated bsdsocket.library calls) function with regard to multi-tasking in WinUAE? Is it possible for multi-tasking context switches to take place during a blocking call to bsdsocket.library for example?
If the Amiga OS just sees these calls as a single 680x0 instruction which causes the native code to be triggered then I would assume no context switching is possible until the native code has completed but that doesn't seem to be the case because we don't see any indication of that happening with regard to things freezing. I am interested to know how this works and if there are any limitations around this. |
16 April 2022, 17:13 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
bsdsocket uses host-side threads that handle all the blocking winsocket calls.
Also if bsdsocket native code needs to call for example exec (or any uae expansion that has native part), it returns back to 68k side by hijacking original Amiga task that called bsdsocket function and uses it to call exec/Wait or similar functions (Amiga side memory allocation, exec messages etc). When function returns it restores context (registers) and continues normally. Amiga task -> bsdsocket library function -> native trap -> native code -> back to m68k side and call exec/wait -> back to native code -> bsdsocket library call returns is one example. It is quite flexible system, any Amiga side library LVO can be called as long as base address is known and it can be called from any task (does not require process). Recursive calling is not possible. |
19 April 2022, 10:12 | #3 |
Not a Rebel anymore
Join Date: Apr 2005
Location: UK
Age: 51
Posts: 497
|
thanks for the explanation
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot select bsdsocket.library? | floppyrobby | support.WinUAE | 6 | 24 October 2020 16:17 |
"Multi-tasking ready" games. | vext01 | Retrogaming General Discussion | 19 | 15 May 2019 09:52 |
Bsdsocket.Library | Emufr3ak | Coders. Asm / Hardware | 5 | 25 December 2016 11:20 |
Crosscompiling with bsdsocket.library | ciVic | Coders. General | 6 | 05 January 2016 11:56 |
winuae bsdsocket.library | clauddio | support.WinUAE | 5 | 21 July 2015 21:47 |
|
|