English Amiga Board Amiga Lore


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 01 September 2017, 19:27   #21
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 46
Posts: 358
No obvious bug in the segment of the source code you posted. From your description, the bug most probably exists in where you handle the window events and/or your shutdown code.
alkis is online now  
AdSense AdSense  
Old 03 September 2017, 20:04   #22
chocsplease
Registered User

 
Join Date: Dec 2016
Location: london
Posts: 140
OK I've found out how to reproduce the crash consistently. It happens if you move or resize the window while its in the update code (win_write). What I don't know is how to prevent this. It looks like its some kind of race condition.

I seem to remember reading something about this on a web site but cannot remember where or if there was a solution.

I guess I'll have to stop the Amiga responding to messages while the window is updating? But how do I do that??

Anyone any ideas?
chocsplease is offline  
Old 03 September 2017, 20:32   #23
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,476
You can use IDCMP_SIZEVERIFY or better, IDCMP_CHANGEWINDOW to be notified when the window is about to be resized or moved.
mark_k is offline  
Old 12 September 2017, 11:54   #24
chocsplease
Registered User

 
Join Date: Dec 2016
Location: london
Posts: 140
Quote:
Originally Posted by mark_k View Post
You can use IDCMP_SIZEVERIFY or better, IDCMP_CHANGEWINDOW to be notified when the window is about to be resized or moved.
Hi Many thanks for the reply and sorry its taken a while to get back.

I'm not sure I can use IDCMP_SIZEVERIFY as having read up on it there is a warning about using AmigaDos functions inside a routine that is called by SIZEVERIFY, or any of the verify functions as AmigDos could display a requester and wait for this while my code is waiting for dos, result - deadlock.

I'm asking for messages when the user switches floppy disks, which could result in the AmigaDos - you must replace disk foo in drive whatever requester.

I am using IDCMP_NEWSIZE, and will change this to IDCMP_CHANGEWINDOW, however I cannot find anything that will allow me to queue this message (like the verify functions do) so am wondering if I will still get my problem when the user resizes the window while it is still updating?

I thought about using modifyIDCMP and clearing the messages at the start of the update, but this will result in me loosing the disk change messages etc.

I've found the Forbid, Permit pair - would this solve the problem? It seems a bit heavy handed to stop all multitasking but the net does suggest that they will prevent the sort of race condition I am running into.

Anyone any thoughts?

Thanks in advance and sorry for such a long post.
chocsplease is offline  
Old 12 September 2017, 17:51   #25
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 46
Posts: 358
I think it would help if you write up a minimum C source (fully compilable) that exhibits the problem.
alkis is online now  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying the get bold, italic and coloured text out to the shell window. chocsplease Coders. C/C++ 16 22 June 2017 14:58
Simple and ugly text wrapping routine rockersuke Coders. AMOS 7 21 November 2014 22:31
How can I do I/O redirection to a simple console window? Leffmann Coders. System 5 26 October 2014 23:42
Searching for a simple Text Editor Morbane request.Apps 2 01 January 2012 01:05
Standard output window Rixa support.Apps 5 17 January 2008 23:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:05.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.10877 seconds with 14 queries