Changeset 5179a0 in git
- Timestamp:
- Jul 29, 2013, 6:33:46 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- a4480646ef09cf15409cf635907aae92d5e81d7c
- Parents:
- cca4407deeb250aa255ceccd313c30b53dfd49f2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/links/ssiLink.cc
rcca4407 r5179a0 72 72 73 73 #ifdef HAVE_SIMPLEIPC 74 #include <Singular/ simpleipc.h>74 #include <Singular/links/simpleipc.h> 75 75 #endif 76 76 //#if (_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600) … … 1565 1565 si_link l; 1566 1566 ssiInfo *d; 1567 #ifdef HAVE_MPSR1568 MP_Link_pt dd;1569 #endif1570 1567 int d_fd; 1571 1568 fd_set mask, fdmask; … … 1575 1572 1576 1573 /* timeout */ 1577 #ifdef HAVE_PSELECT1578 struct timespec wt;1579 struct timespec *wt_ptr=&wt;1580 #else1581 1574 struct timeval wt; 1582 1575 struct timeval *wt_ptr=&wt; 1583 #endif1584 1576 int startingtime = getRTimer()/TIMER_RESOLUTION; // in seconds 1585 1577 if (timeout== -1) … … 1590 1582 { 1591 1583 wt.tv_sec = timeout / 1000000; 1592 #ifdef HAVE_PSELECT1593 wt.tv_nsec = 1000 * (timeout % 1000000);1594 #else1595 1584 wt.tv_usec = timeout % 1000000; 1596 #endif1597 }1598 1599 /* signal mask for pselect() */1600 sigset_t sigmask;1601 if(sigprocmask(SIG_SETMASK, NULL, &sigmask) < 0)1602 {1603 WerrorS("error in sigprocmask()");1604 return -2;1605 }1606 if(sigaddset(&sigmask, SIGCHLD) < 0)1607 {1608 WerrorS("error in sigaddset()");1609 return -2;1610 1585 } 1611 1586 … … 1632 1607 && (strcmp(l->mode,"launch")!=0) && (strcmp(l->mode,"connect")!=0))) 1633 1608 { 1634 WerrorS("all links must be of type ssi:fork, ssi:tcp, ssi:connect,"); 1635 WerrorS(" MPtcp:fork or MPtcp:launch"); 1609 WerrorS("all links must be of type ssi:fork, ssi:tcp, ssi:connect"); 1636 1610 return -2; 1637 1611 } 1638 #ifdef HAVE_MPSR1639 if (strcmp(l->m->type,"ssi")==0)1640 {1641 d=(ssiInfo*)l->data;1642 d_fd=d->fd_read;1643 if (!s_isready(d->f_read))1644 {1645 FD_SET(d_fd, &fdmask);1646 if (d_fd > max_fd) max_fd=d_fd;1647 }1648 else1649 return i+1;1650 }1651 else1652 {1653 dd=(MP_Link_pt)l->data;1654 d_fd=((MP_TCP_t *)dd->transp.private1)->sock;1655 FD_SET(d_fd, &fdmask);1656 if (d_fd > max_fd) max_fd=d_fd;1657 }1658 #else1659 1612 d=(ssiInfo*)l->data; 1660 1613 d_fd=d->fd_read; … … 1666 1619 else 1667 1620 return i+1; 1668 #endif1669 1621 } 1670 1622 } … … 1686 1638 sipc_semaphore_release(0); 1687 1639 #endif 1688 #ifdef HAVE_PSELECT1689 s = si_pselect(max_fd, &mask, NULL, NULL, wt_ptr, &sigmask);1690 #else1691 SSI_BLOCK_CHLD;1692 1640 s = si_select(max_fd, &mask, NULL, NULL, wt_ptr); 1693 SSI_UNBLOCK_CHLD;1694 #endif1695 1641 #ifdef HAVE_SIMPLEIPC 1696 1642 sipc_semaphore_acquire(0); … … 1715 1661 { 1716 1662 l=(si_link)L->m[i].Data(); 1717 #ifdef HAVE_MPSR1718 if (strcmp(l->m->type,"ssi")!=0)1719 {1720 // for MP links, return here:1721 dd=(MP_Link_pt)l->data;1722 d_fd=((MP_TCP_t *)dd->transp.private1)->sock;1723 if(j==d_fd) return i+1;1724 }1725 else1726 {1727 d=(ssiInfo*)l->data;1728 d_fd=d->fd_read;1729 if(j==d_fd) break;1730 }1731 #else1732 1663 d=(ssiInfo*)l->data; 1733 1664 d_fd=d->fd_read; 1734 1665 if(j==d_fd) break; 1735 #endif1736 1666 } 1737 1667 } … … 1765 1695 timeout - 1000000*(getRTimer()/TIMER_RESOLUTION - startingtime)); 1766 1696 wt.tv_sec = timeout / 1000000; 1767 #ifdef HAVE_PSELECT1768 wt.tv_nsec = 1000 * (timeout % 1000000);1769 #else1770 1697 wt.tv_usec = (timeout % 1000000); 1771 #endif1772 1698 } 1773 1699 goto do_select; -
configure.ac
rcca4407 r5179a0 34 34 35 35 AC_HEADER_STDC 36 AC_CHECK_HEADERS(unistd.h iostream.h )36 AC_CHECK_HEADERS(unistd.h iostream.h sys/time.h sys/times.h asm/sigcontext.h) 37 37 38 AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv )38 AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv pselect) 39 39 40 40 -
kernel/mod2.h
rcca4407 r5179a0 56 56 57 57 #endif 58 59 /* include simpleipc/semaphore code, link against librt/libpthread */ 60 #define HAVE_SIMPLEIPC 1 61 58 62 59 63 /* linear algebra extensions from pcv.h/pcv.cc */
Note: See TracChangeset
for help on using the changeset viewer.