Is libInit() protected from switching i.e not running multitask

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
gdridi
Posts: 98
Joined: Sat Aug 11, 2012 11:17 am
Contact:

Is libInit() protected from switching i.e not running multitask

Post by gdridi »

Hello!

I see difference between running my library between AOS4.1FinalEditionUpdate0 and AOS4.1FEUpdate2

Is there a Forbid() done by the Kernel when libInit() is called to initialize library code ? That was removed in AOS4.1FinalEditionUpdate2 ?

This leads to instability when launching multiple instances of my library at the same time. So libInit() must be protected by a Forbid().

This could explain mysterious bug ?
When launching multiple instances of program in parallel that use a same library.

Sincerely yours,

DGILLES
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 913
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: Is libInit() protected from switching i.e not running multitask

Post by Hypex »

I don't see any indication from OS3 or OS4 documentation you need to isolate the libInit() in a Forbid()/Permit() lock. It's possible there was a change in kernel routines that has the side effect of causing instability. However, if your library is having issues with parallelism, it might be a good idea to protect the libInit() routine regardless. This need not be a classic Forbid()/Permit() lock frowned upon. This could be a semaphore, but a semaphore has the same locking issue, since internally it's managed by another Forbid()/Permit() lock. So a mutex might be a better idea in this case for OS4 native code.
Post Reply