[AD] [ alleg-Bugs-1692717 ] some bugs

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #1692717, was opened at 2007-04-02 18:25
Message generated for change (Comment added) made by tjaden
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1692717&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: erno (scherno2000)
Assigned to: Nobody/Anonymous (nobody)
Summary: some bugs

Initial Comment:
1. rest(0) does not yield.
2. in fbcon.c console_users is incremented twice, but decremented only once.
3. If allegro application is run in console mode, and get_tty() returns 0 (running application from midnight commander), problems with threads created before fork().
4. If allegro application is run in console mode, from midnight commander, then the shell thinks the application is ended too early because of main process is killed in allegro initialization.

Please read the readme file in attached zip file.


----------------------------------------------------------------------

>Comment By: Peter Wang (tjaden)
Date: 2007-04-02 19:16

Message:
Logged In: YES 
user_id=28616
Originator: NO

Please generate a diffs for each change and send those if possible. It's
difficult to see what's going on and apply your changes. Thanks.


----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2007-04-02 19:07

Message:
Logged In: YES 
user_id=32894
Originator: NO

I'll look at the .zip later. About utime.c - what did you modify and why?

----------------------------------------------------------------------

Comment By: erno (scherno2000)
Date: 2007-04-02 19:03

Message:
Logged In: YES 
user_id=1542934
Originator: YES

In the zip file is an example you can test:

showa16.cpp
.
The problem is, that select(...) with timeout == 0 does not yield to the
other thread. (See the select man page),
but the allegro documentation says that. If the timeout is <> 0 every
thing is OK. If I am calling sched_yield() instead of
select with timeout==0 every thing is OK. I tested this with the modified
version of utime.c (in the zip file) too, and changed the rest parameter
with -1.
 

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2007-04-02 18:32

Message:
Logged In: YES 
user_id=32894
Originator: NO

I don't know about console mode, but about rest(0), what makes you believe
what you said? From the sources (src/unix/usystem.c), this is the function
called when you do rest(0) in unix:

void _unix_yield_timeslice(void)
{
   #if defined(ALLEGRO_USE_SCHED_YIELD) &&
defined(_POSIX_PRIORITY_SCHEDULING)

      sched_yield();

   #else

      struct timeval timeout;
      timeout.tv_sec = 0;
      timeout.tv_usec = 0;
      select(0, NULL, NULL, NULL, &timeout);

   #endif
}

So normally it directly calls sched_yield (e.g. in linux), and if that's
not available, it will do a select with time 0, which also will call back
to the scheduler and give other programs a chance to run. Note that
yielding does not imply giving up any CPU time in case you expected that..

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1692717&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/