From owner-freebsd-hackers@freebsd.org Thu Aug 24 00:51:50 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6F1DF1E69 for ; Thu, 24 Aug 2017 00:51:50 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com [IPv6:2607:f8b0:400e:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 747433349 for ; Thu, 24 Aug 2017 00:51:50 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-pg0-x236.google.com with SMTP id u191so7935360pgc.2 for ; Wed, 23 Aug 2017 17:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/IanF8N7cN6okQ1Q+zClyPqYrsSnH9bi6+PJbx5iPOo=; b=RB6821wpo40I11h7kVu86bnFPca9EhWxGgDATQuw0oMkrTA/zFWRWTr/XLnx1OZQwZ 3PfAQ1qHkpdImM/yiQlm7i64K2E4MZ+cgardnEpTSDUkekaK4MspvZ5PjX19VKCVSmK8 dmkBbfrFVit+mCtc8X7ZH2epHvLZwfcZqp7Zvs0kxIHF8fso47tsBwL4PjnDyR2OVc0U 0xMfzBLnbRAP6Sko2oOKQDKbHEZVWRD3/+hPScR6OrfGUL0rgmHVgsg0j5j3JDk4n7Hq ZlKIrAHZI4Ir3Z3gfiAJ7YzHpSu73KBkg5KsNywmzMFrHP/EVNhRjOqgaZNEjGfveSjZ ++6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/IanF8N7cN6okQ1Q+zClyPqYrsSnH9bi6+PJbx5iPOo=; b=fpGIKVmdB88Kbb6GKDiCUlkand5MjAxU9maQ93cfV/cFlFpkpgmpr+TqWX8Fy9l04k R6IT6spK+61Tt5BBoOPqImWuG2lgTF3gUnFf1qEQx4ns9fJNa+NdB9dETO+PLEgbXuDv 07w/tcZA0BsGzTkqzbgzaMwX4L2mdg97dAgo7rDKS31oloDU7gwuyc9XXhZltoWKiygn SehtQ6Q0+HDrDH8A7CjQBVtv/+Jmu6KS31zKoLhWmDMweQVLkGmnHKbrB0wTNVnrWIlb neL4q50TNH4AJbBwE8sna/d73ZIdJtI09BQhxhyw5vEDxeWscLkBa2RXkDqt2Mu89d1Q B+JA== X-Gm-Message-State: AHYfb5geaN3b9Fo/jqNmkJlQhOoK5Zhhq1UTQinm+xeltKwl4Tv0buJS +pgndacuYMnzy9qmRTtnwhborWTACJ6C X-Received: by 10.98.149.205 with SMTP id c74mr257447pfk.194.1503535909753; Wed, 23 Aug 2017 17:51:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.186.237 with HTTP; Wed, 23 Aug 2017 17:51:26 -0700 (PDT) From: Farhan Khan Date: Wed, 23 Aug 2017 20:51:26 -0400 Message-ID: Subject: taskqueue(9) guidance To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 00:51:50 -0000 Hi all, I am trying to understand taskqueue(9) through writing some code, but am unable to get a functioning example. The expected code I thought does not run. I reviewed some sample code within the kernel, mostly drivers. The general pattern I identified was taskqueue_create(9), taskqueue_start_threads(9), and finally the TASK_INIT macro. I also created some structures and place them within the "struct taskqueue" and "struct task". I am not certain why this done, rather than allocate those who structures on their own, but it appeared to be the standard. My code is below: https://pastebin.com/dFqPsA5A I am expecting to see the repeater_proc() function to execute, but that does not occur. Also, I did not specify the frequency, whether it should repeat, etc. I do not understand why the code is not running or what mistake I am making. Please assist. Thank you! -- Farhan Khan PGP Fingerprint: 782F 342B 5B08 0D2F F4E8 82C3 FFA1 CAE1 6536 51CA