36
36
* Task descriptors.
39
* Revision 1.25 2002/04/16 15:04:50 pvmsrc
40
* Fixed bug in task_cleanup():
41
* - & vs && in scheduler notification code... :-Q
42
* - bug report submitted by Yan Xiao <yxiao@BlackstoneComputing.com>.
45
* Revision 1.24 2002/02/21 23:18:07 pvmsrc
46
* Added new (not to be documented!) PVM_MAX_TASKS env var support.
47
* - for Mahir Lokvancic <mahir@math.ufl.edu>.
48
* - forcefully limits the number of tasks that can attach to a
49
* pvmd, required on Solaris in rare circumstances when hard
50
* FD_SETSIZE limit is reached, and all hell breaks loose...
51
* - check pvm_max_ntasks global when allocating new tasks
53
* - in task_new() call, if limit reached return NULL ptr,
54
* indicating PvmOutOfRes...
55
* - keep track of private "ntasks" counter in task_new()/task_free(),
56
* only increment for non-zero tids (avoid counting temp task
60
* Revision 1.23 2001/02/07 23:15:54 pvmsrc
61
* 2nd Half of CYGWIN Check-ins...
64
* Revision 1.22 2000/09/01 14:39:22 pvmsrc
65
* Plugged memory (waitc) leak in task_cleanup():
66
* - better get rid of any notify wait contexts, if the task is
67
* dead we probably don't care any more...
68
* - added wait_delete() for WT_HOSTA, WT_TASKX, WT_ROUTEA, WT_ROUTED.
69
* - I hope this doesn't break any shit... :-o
72
* Revision 1.21 2000/02/17 23:12:19 pvmsrc
73
* *** Changes for new BEOLIN port ***
74
* - MPP-like, similar to SP2, etc.
75
* - submitted by Paul Springer <pls@smokeymt.jpl.nasa.gov>.
76
* - format-checked & cleaned up by Jeembo... :-)
79
* Revision 1.20 2000/02/16 22:00:30 pvmsrc
80
* Fixed up #include <sys/types.h> stuff...
81
* - use <bsd/sys/types.h> for IMA_TITN...
82
* - #include before any NEEDMENDIAN #includes...
39
85
* Revision 1.19 1999/07/08 19:00:15 kohl
40
86
* Fixed "Log" keyword placement.
41
87
* - indent with " * " for new CVS.
227
279
extern int taskertid; /* from pvmd.c */
228
280
extern struct Pvmtracer pvmtracer; /* from pvmd.c */
229
281
extern int tidlmask; /* from pvmd.c */
282
extern int pvm_max_ntasks; /* from pvmd.c */
231
284
struct task *locltasks = 0; /* all task structs sorted by tid */
388
443
struct task *tp, *tp2;
447
if (pvmdebmask & PDMTASK) {
448
pvmlogprintf("task_new(%d) ntasks=%d pvm_max_ntasks=%d\n",
449
tid, ntasks, pvm_max_ntasks );
451
if (pvm_max_ntasks && ntasks > pvm_max_ntasks) {
452
pvmlogprintf("task_new() too many tasks?\n");
453
ntasks--; /* this one didn't make it... :-) */
454
return( (struct task *) NULL );
390
458
if (!(tp = TALLOC(1, struct task, "task"))) {
391
459
pvmlogprintf("task_new() can't get memory\n");
433
501
/* XXX this is inside out - mpp_free should call task_free.
434
502
XXX but for now task_free is what's called.
435
XXX this will change in the portable processor interface cleanup. */
503
XXX this will change in the portable processor interface
436
505
mpp_free(tp->t_tid);
438
510
if (tp->t_plink && tp->t_prlink) {
439
511
LISTDELETE(tp, t_plink, t_prlink);