Search results

  1. nslay

    Threaded programming

    Yes, they will be scheduled across both cores in both cases. You can test this by spawning two threads and watching top (you will see CPU usage of 200%).
  2. nslay

    Is FreeBSD for me?

    Of course you get configurability in PC-BSD. It's FreeBSD. The same is true for Ubuntu which is just the same old Linux + GNU under the hood. PC-BSD and Ubuntu are just trying to be user friendly and more practical for those too strapped for time to read the Handbook. While FreeBSD frequently...
  3. nslay

    Is FreeBSD for me?

    Just based on the first sentence: yes, it's for you. For a typical end-user, there's just no practical reason to use any Linux distribution or BSD OS (OK, OS X, iOS, and Android being exceptions). But you're not typical because you've been running with different Linux OS's for a few years now...
  4. nslay

    SVN branch for 10.0-RELEASE created

    I just upgraded. Works great! Well, I'm using STABLE. Release branch creation seems to correspond to all debugging turned off. EDIT: Here's a gotcha for anyone who uses MODULES_OVERRIDE: ums is no longer in the GENERIC kernel config. If you're reconfiguring from GENERIC for FreeBSD 10, be...
  5. nslay

    Clang void with wildcardb reference

    Try moving void *_a[] to be the last field of the struct.
  6. nslay

    Compiler error when using map[key] = value syntax

    My guess is that you only need a default constructor when using std::map::operator[]() since this operator inserts a default-constructed element when a given key is not found in the map. If I recall correctly, since std::map is templated, this operator will not even be instantiated unless used...
  7. nslay

    <cmath> and namespace std

    Unless you need to deal with NaN safely, you could just use std::max from <algorithm> instead. #include <algorithm> int main(int argc, char **argv) { double m = std::max(2.0, 8.0); return 0; }
  8. nslay

    [C++] No notifications from kqueue (async connect )

    If it's a small amount of data, you could always loop until send completes. uint8_t *pBuf; // Assumed initialized size_t bufSize; // Ditto ssize_t sendSize; while (bufSize > 0) { sendSize = send(fd, pBuf, bufSize, 0); if (sendSize == -1) { if (errno != EAGAIN) { // Bad real bad...
  9. nslay

    Possible server intrusion

    I agree. If the socket is closed and in a TIME_WAIT state, then the behavior follows from sockstat. However, nfsd and lockd both have the sockets opened and are listening. I see nothing in the above post or in sockstat that suggests that the first four columns should be meaningless in this case...
  10. nslay

    [C++] No notifications from kqueue (async connect )

    Yes, when you're intentionally sending a lot of data, then you intentionally poll for EVFILT_WRITE. But you normally wouldn't want to poll for EVFILT_WRITE. Try unconditionally polling for EVFILT_WRITE and report your CPU usage.
  11. nslay

    Possible server intrusion

    It happens for me with some NFS services: ? ? ? ? udp4 *:* *:* ? ? ? ? udp4 *:2049 *:* ? ? ? ? tcp4 *:778 *:* ? ? ? ? udp4 *:955 *:* The...
  12. nslay

    [C++] No notifications from kqueue (async connect )

    Once connect completes, then you subscribe to EVFILT_READ. A socket will almost always be writable after connect completes and so you will flood your event loop with useless EVFILT_WRITE notifications. In contrast, if a connect completes, it may not be readable (since the server may not have...
  13. nslay

    [C++] No notifications from kqueue (async connect )

    When polling for connect with kqueue, just poll for EVFILT_WRITE. I think this is a good exercise and all, but I really recommend libevent. You're probably just going to re-implement an event loop anyway. You can even have it use kqueue. And it even supports aio and deals with signals correctly.
  14. nslay

    How to compile CUDA applications?

    The libcudart.so should be in your /compat/linux/usr/lib and not /usr/local/lib. For Linux applications, the runtime linker will implicitly look in /compat/linux (if this is where your Linux environment lives). You could also add libcudart.so to /etc/libmap.conf to help the runtime linker...
  15. nslay

    How to compile CUDA applications?

    Unfortunately, there is no native CUDA toolchain. Although, I did see some Japanese blog (I can't read Japanese) a while ago that seemed to suggest that the author was able to compile and run CUDA applications on FreeBSD through the Linux CUDA toolchain (through Linux emulation). That aside...
  16. nslay

    can not find if_bge.c for FreeBSD 10.0 at http://svnweb.freebsd.org

    How about this? http://svnweb.freebsd.org/base/head/sys/dev/bge/ Line 220 of if_bge.c: { BCOM_VENDORID, BCOM_DEVICEID_BCM57765 },
  17. nslay

    kqueue socket stream

    It's really not a big dependency. The whole library is basically a loop implemented very carefully. And this event loop is what you would normally implement in a standard socket program anyway. And on top of that, it has some helper functions. Event loops themselves are easy to implement. Event...
  18. nslay

    kqueue socket stream

    Seriously, just use libevent. It supports all the high performance multiplexers (including kqueue) on all major operating systems.
  19. nslay

    socket programming

    You might also find getaddrinfo a better and more convenient way to set these structures up. For as general and powerful as sockets are, the whole type punning is just an awful mess ... const char *address = "127.0.0.1"; const char *port = "1234"; struct addrinfo hints, *res = NULL; int e...
  20. nslay

    C : vprintf an array

    If you plan to have a format string, why not just expand the array elements yourself? A format string written by a human would never be impractically long. There's nothing wrong with the following printf("%s %s %s", arg[0], arg[1], arg[2]); If you ever did intend to write a format string with...
Back
Top